我对 PHP 和表单有点陌生。我正在尝试以 PHP 形式将一些变量从一个页面发送到另一个页面。
这是表格:
<form name="dates" action="document_creation/7bform.php" method="post" onsubmit="return mandatoryFields()">
<table width="748" border="0" cellspacing="2" cellpadding="2">
<tr>
<td class="main_text">
<div align="right" class="main_text">*Contract Start Date:</div>
</td>
<td>
<input name="start_date" type="text" value="YYYY-MM-DD" maxlength="100" class="datepick" id="date1" />
</td>
</tr>
<tr>
<td class="main_text">
<div align="right" class="main_text">*Contract End Date:</div>
</td>
<td>
<input name="end_date" type="text" value="YYYY-MM-DD" maxlength="100" class="datepick" id="date2" />
</td>
</tr>
<tr>
<td height="36" colspan="2">
<table width="100" border="0" align="center" cellpadding="2" cellspacing="2">
<tr>
<td width="68"> <input name="submit" type="submit" id="Submit" value="Generate 7B Form" <?php if($disable ==1){?>disabled<?php }?>/></td>
<td width="48">
<label><input type="reset" name="reset" value="Reset" /></label>
</td>
<td width="46"><div align="center"><a href="javascript:history.go(-1);">Back</a></div></td>
</tr>
</table>
</td>
</tr>
</table>
</form>
我想通过start_date
并end_date
转到另一个页面document_creation/7bform.php
,但它不起作用。document_creation/7bform.php看起来像这样:
<?php
$start_date = ($_POST['start_date']);
$end_date = ($_POST['end_date']);
当我尝试打印这些变量时,它们显示为空白。我哪里错了?