我有一个小表格:
//GET the unit and community id
$UNIT = $_GET['unit'];
$COMID = $_GET['comid'];
...//i have echoed $UNIT and $COMID to ensure that they do have values
...
<form action="ModifyNoteScript.php" method="post" />
<input name="Comment" type="hidden" value="<?php echo $Comment; ?>" />
<input name="UNIT" type="hidden" value="<?php echo $UNIT; ?>" />
<input name="COMID" type="hidden" value="<?php echo $COMID; ?>" />
<textarea name="Comment" cols="55" rows="6" class="text1" id="Comment"><?php echo $Comment; ?>
</textarea>
<br />
<input type="submit" name="sendnotify" class="formbutton" id="Submit" value="Replace previous note with current" />
</form>
就是这个:
如您所见,我正在将变量设置comment
为textarea
它毫无问题地传递到下一页 ModifyNoteScript.php。
UNIT
但是,其他两个变量COMID
由于某种原因被传递为[blanks]
这是 ModifyNoteScript.php 的样子:
<?php
include '../Check.php';
include '../CustomConnect.php';
$UNIT= $_POST['unit'];
$COMID= $_POST['comid'];
$NOTE= $_POST['Comment'];
$comment_update = mssql_query("UPDATE pmp_property__unit
SET
comments = '$NOTE'
WHERE
communityidy='$COMID' and
unit='$UNIT'")
or die ("Changes to Record could not be Saved.");
?>
为什么这两个变量作为空白传递?