<?php
require('config.php');
if(isset($_POST['submit'])){
}else{
$form =<<<EOT
<form action="reg.php" method="POST">
First Name: <input type="text" name="name"/><br />
Last Name: <input type="text" name="lname"/><br />
Username: <input type="text" name="uname"/><br />
Email: <input type="text" name="email1"/><br />
Confirm Email: <input type="text" name="email2"/><br />
Password: <input type="password" name="pass1"/><br />
Confirm Password: <input type="password" name="pass2"/><br />
<input type="submit" value="Register" name="submit"/>
</form>
EOT;
echo $form;
}
?>
答案 0 :(得分:6)
你的“EOT”不能缩进,它必须在行的开头(遗憾地)。
答案 1 :(得分:2)
在开始和结束EOT的定义时你不能有意图......看下面的代码。这不好(它搞砸了其余代码的意图),但这是唯一的方法。
<?php
require('config.php');
if(isset($_POST['submit'])){
}else{
$form =<<<EOT
<form action="reg.php" method="POST">
First Name: <input type="text" name="name"/><br />
Last Name: <input type="text" name="lname"/><br />
Username: <input type="text" name="uname"/><br />
Email: <input type="text" name="email1"/><br />
Confirm Email: <input type="text" name="email2"/><br />
Password: <input type="password" name="pass1"/><br />
Confirm Password: <input type="password" name="pass2"/><br />
<input type="submit" value="Register" name="submit"/>
</form>
EOT;
}
echo $form;
?>