1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Vui lòng đăng nhập để sử dụng Chat Box và nhiều tính năng hơn nữa
    Dismiss Notice

Anh em giúp sửa đoạn php if else với

Discussion in 'PHP' started by Fakerismd, Dec 5, 2016.

  1. Fakerismd

    Fakerismd Member

    Joined:
    Sep 27, 2016
    Messages:
    54
    Likes Received:
    4
    Trophy Points:
    8
    PHP:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "[URL]http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd[/URL]"&gt;
    <html xmlns="[URL]http://www.w3.org/1999/xhtml[/URL]"&gt;
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Số lớn</title>
    </style>
    </head>

    <body><?php $time=$_POST["time"];
    $chao=if($time>="0" && $time<="13"){ echo"Сhào buổi sáng!!!";} else if($time>="13" && $time<="18"){ echo"Chào buổi chiều";} else if($time>="18&& $time<="24{ echo"Chào buổi tối";}?>
    <form id="form1" name="form1" method="post" action="hl.php">
    <table width="400" border="0" align="center" bgcolor="[HASHTAG]#CCFF99[/HASHTAG]">
    <tr>
    <td colspan="2″ align="center" bgcolor="#FF66CC″><h1 class="style1">Chào </>
    </tr>
    <tr>
    <td><strong>số g</strong></td>
    <td><label>
    <input name="time" type="text" id="time" value="<?php echo $_POST["time" />
    </
    label></td>
    </
    tr>
    <
    td><strong>chao</strong></td>
    <
    td><label>
    <
    input name="chao" type="text" id="chao" value="<?php echo $chaoreadonly="true" style="background-color:[HASHTAG]#FF99FF[/HASHTAG]" />
    </
    label></td>
    </
    tr>
    <
    tr>
    <
    td colspan="2" align="center"><label>
    <
    input type="submit" name="Submit" value="in"></label></td>
    </
    tr>
    </
    table>
    </
    form>
    </
    body>
    </
    html>
    . ae xem hộ ở cái đoạn if else. với.. mình mới học.. không biết lỗi ở đâu ..với sửa sao đây
     
    Last edited by a moderator: Dec 5, 2016
    Sondvb likes this.
  2. TranDuc

    TranDuc Member

    Joined:
    Dec 12, 2015
    Messages:
    97
    Likes Received:
    52
    Trophy Points:
    18
    PHP:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "[URL]http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd[/URL]"&gt;
    <html xmlns="[URL]http://www.w3.org/1999/xhtml[/URL]"&gt;
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Số lớn</title>
    </style>
    </head>

    <body>
    <?php 
    $time
    =$_POST["time"];
    if(
    $time >= "0" && $time <= "13")
    { echo 
    "Сhào buổi sáng!!!";}
     else if(
    $time >= "13" && $time <= "18")
    { echo 
    "Chào buổi chiều";} 
    else if(
    $time >= "18&& $time <= "24)
    { echo 
    "Chào buổi tối";}
    ?>
    <form id="form1" name="form1" method="post" action="hl.php">
    <table width="400" border="0" align="center" bgcolor="[HASHTAG]#CCFF99[/HASHTAG]">
    <tr>
    <td colspan="2″ align="center" bgcolor="#FF66CC″><h1 class="style1">Chào </>
    </tr>
    <tr>
    <td><strong>số g</strong></td>
    <td><label>
    <input name="time" type="text" id="time" value="<?php echo $_POST["time" />
    </
    label></td>
    </
    tr>
    <
    td><strong>chao</strong></td>
    <
    td><label>
    <
    input name="chao" type="text" id="chao" value="<?php echo $chaoreadonly="true" style="background-color:[HASHTAG]#FF99FF[/HASHTAG]" />
    </
    label></td>
    </
    tr>
    <
    tr>
    <
    td colspan="2" align="center"><label>
    <
    input type="submit" name="Submit" value="in"></label></td>
    </
    tr>
    </
    table>
    </
    form>
    </
    body>
    </
    html>
    Thử xem được chưa, viết sai nhiều quá :3
     
    Fakerismd and NamLee like this.

Share This Page

Loading...