应用定界符输出用户登录表单

一 实例代码

<title>应用定界符输出用户登录表单</title>
<?php
$str=<<<user
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>用户登录</title>
<link rel="stylesheet" type="text/css" href="style.css" />
<body>
<table width="250" height="100" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td bgcolor="#666666"><table width="250" height="100" border="0" cellpadding="0" cellspacing="1">
     <form name="form1" method="post" action="index.php">
	  <tr>
        <td height="25" colspan="2" bgcolor="#DDAACC"><div align="center">用户登录</div></td>
      </tr>
      <tr>
        <td width="60" height="25" bgcolor="#FFFFFF"><div align="right">用户名:</div></td>
        <td width="187" bgcolor="#FFFFFF">&nbsp;<input type="text" name="ip" size="18" class="inputcss"></td>
      </tr>
      <tr>
        <td height="25" bgcolor="#FFFFFF"><div align="right">密码:</div></td>
        <td height="25" bgcolor="#FFFFFF">&nbsp;<input type="text" name="ipNum" size="18" class="inputcss"></td>
      </tr>
      <tr>
        <td height="25" colspan="2" bgcolor="#FFFFFF"><div align="center"><input name="submit" type="submit" class="buttoncss" value="登录" />
</div></td>
      </tr>
	  </form>
    </table></td>
  </tr>
</table>
</body>
</html>
user;
echo $str;
?>

 

二 运行结果

 
三 运行分析
结束标识符user必须单独另起一行,并且不允许有空白字符。如果在标识符前后有其他符号、字符或注释,则发生错误。

猜你喜欢

转载自cakin24.iteye.com/blog/2348453