我有一個小表格:如何在提交時傳遞多個變量?
//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.");
?>
爲什麼經過作爲空白兩個變量?
什麼是自閉窗體標籤? – Musa 2013-03-04 19:14:56