<h2>Nepal Form</h2>
<p><span class="error">* required field.</span></p>
<form method="post" action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]);?>">
Name: <input type="text" name="name" value="<?php echo $name;?>">
<span class="error">* <?php echo $nameErr;?></span>
<br><br>
E-mail: <input type="text" name="email" value="<?php echo $email;?>">
<span class="error">* <?php echo $emailErr;?></span>
<br><br>
Website: <input type="text" name="website" value="<?php echo $website;?>">
<spanc class="error"><?php echo $websiteErr;?></span>
<br><br>
Comment: <textarea name="comment" rows="5" cols="40"><?php echo $comment;?></textarea>
<br><br>
Gender:
<input type="radio" name="gender" <?php if (isset($gender) && $gender=="female") echo "checked";?> value="female">Female
<input type="radio" name="gender" ?php if (isset($gender) && $gender=="male") echo "checked";?> value="male">Male
<span class="error">* <?php echo $genderErr;?></span>
<br><br>
<input type="submit" name="submit" value="Submit">
</form>
Hello Guys,我是一个PHP表单,我在这个表单编码上发现错误,我想知道它是什么。我搜索了serval时间,但无法弄明白!在此先感谢!
答案 0 :(得分:1)
<input type="radio" name="gender" <?php if (isset($gender) &&
在第17行你还没有给出“&lt;”如上所述改变php。
<span class="error"><?php echo $websiteErr;?></span>
在第11行,你已经给出了spanc改变它。
我希望这对你有用!!