哪位仁兄给小弟详细列些echo内嵌入HTML页面元素的用法.关键是echo " 作用域的问题,搞的我一头雾水.最好能配合例子讲解下

解决方案 »

  1.   

    <?
    echo "<input type='text'>";
    ?>
      

  2.   

    <?
    echo <<<NOT
            <TABLE>
              <TR>
      <TD></TD>
      <TD></TD>
              </TR>
              <TR>
      <TD></TD>
      <TD></TD>
              </TR>
             </TABLE>
    NOT;
    ?>
      

  3.   

    echo"<html>\n";
       echo "
        <body>
          <H1><FONT SIZE=12 ><center>世纪情缘</center></FONT></H1>
         <select  name=ID>
          <option></option>";
       include("./conf/21net.inc");
    $assay_cfg=file("conf/21vianet.cfg") or die("系统故障,请与管理员联系。");
      if(count($assay_cfg) < 4 || strlen($assay_cfg[0]) < 7 || strlen($assay_cfg[1]) < 7 || strlen($assay_cfg[2]) < 11 ||strlen($assay_cfg[3]) < 11)
                    die("配置文件21vianet.cfg格式不正确!");
    $host = trim(substr($assay_cfg[0],5,-1));
            $user = trim(substr($assay_cfg[1],5,-1));
            $password = trim(substr($assay_cfg[2],9,-1));
            $database = trim(substr($assay_cfg[3],9,-1));
            $ipaddr= trim(substr($assay_cfg[4],7,-1));
            $connect=@mysql_pconnect($host,$user,$password) or die("数据库联接失败!");
            $sele_db=@mysql_select_db($database,$connect) or die("选择数据库失败!");
    $str="select* from switch";
    $result=mysql_query($str,$connect);
    for($i=0;$i<mysql_num_rows($result);$i++)
    {
    $row=mysql_fetch_array($result);
    $Item[]=$row["name"];
    printf("<option>%s</option>",$Item[$i]);
    }        echo "</select>&nbsp";
    echo"</body></html>";
    为什么我写的这段不能获取下拉框的OPTION项呢?