我在一页上放了两张表格。两种表单单独工作都很好,但是当它们同时放在一个页面上时,它们会相互冲突。以下是两种形式:
联系表:
<form name="contactform" id="contactform" method="post" action="#targetAnchorPage2">
<table>
<?php
if (isset($_POST["name"])){
?>
<tr>
<td colspan="2" class="error">
<?php
require_once("contact_send.php");
?>
</td>
</tr>
<?php
}
?>
<tr><td><label for="name" class="<?=$name_class?>">name:</label></td><td><input type="text" name="name" maxlength="50" value="<?=$name?>"></td></tr>
<tr><td><label for="email" class="<?=$emailaddress_class?>">email:</label></td><td><input type="text" name="email" maxlength="80" value="<?=$emailaddress?>"></td></tr>
<tr><td colspan="2"><label id="tworows" for="message" class="<?=$message_class?>">your message:</label></td></tr><tr><td colspan="2"><textarea name="message" cols="22" rows="6" value="<?=$message_class?>"></textarea>
</td></tr>
<tr>
<td colspan="2" style="text-align:center"><br /><input class="button" type="submit" value="">
</td>
</tr>
</table>
</form>
订阅表格:
<form name="subscribeform" id="subscribeform" method="post" action="#targetAnchorPage3">
<table>
<?php
if (isset($_POST["name"])){
?>
<tr>
<td colspan="2" class="error">
<?php
require_once("subscribe_send.php");
?>
</td>
</tr>
<?php
}
?>
<tr><td><label for="name" class="<?=$name_class?>">name:</label></td><td><input type="text" name="name" maxlength="50" value="<?=$name?>"></td></tr>
<tr><td><label for="email" class="<?=$emailaddress_class?>">email:</label></td><td><input type="text" name="email" maxlength="80" value="<?=$emailaddress?>"></td></tr>
<tr>
<td colspan="2" style="text-align:center"><br /><input class="button" type="submit" value="">
</td>
</tr>
</table>
</form>
如何解决?它是由“required_once”命令引起的吗?