Is there a way to pass the value of a variable in $_POST? I have tried the following code:
$Pickup=4;
...
<form>
....
<input type=hidden name="OT" value=intval($Pickup)>
</form>
However, $_POST['OT'] is passed as "intval(\$Pickup". If I change the line to be:
<input type=hidden name="OT" value="$Pickup">
it passes "\$Pickup". If I leave off the double quotes, it passes the same value. Is there a way so it will pass the value 4?
Passing Values With Forms
Moderator: General Moderators
- Christopher
- Site Administrator
- Posts: 13596
- Joined: Wed Aug 25, 2004 7:54 pm
- Location: New York, NY, US
Re: Passing Values With Forms
Code: Select all
<?php
$Pickup=4;
?>
<form action="mypage.php" method="post">
<input type=hidden name="OT" value="<?php echo intval($Pickup); ?>">
</form>(#10850)
Re: Passing Values With Forms
Thanks.... I knew there was something I was missing.