PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Moderator: General Moderators
orbdrums
Forum Commoner
Posts: 82 Joined: Wed Sep 14, 2011 11:42 pm
Post
by orbdrums » Sat Jun 15, 2013 10:06 pm
Although the php variable displays on the page properly, it is not being picked up in the subsequent page with the _POST option.
Code from source page:
Code: Select all
<form name="frmFriendConf" action="filename.php" method="post" OnSubmit="return onFrndConf();">
<option value="<?= $v_frnd_id; ?>"></option><?= $v_frnd_id; ?>
<input type="submit" name="btnFriendConf" value="Confirm">
</form>
Code from target page:
Code: Select all
$v_frnd_id_in = $_POST['v_frnd_id'];
Any suggestions?
Thanks.
orbdrums
Forum Commoner
Posts: 82 Joined: Wed Sep 14, 2011 11:42 pm
Post
by orbdrums » Sat Jun 15, 2013 11:39 pm
I should have been using the <input> tag instead of the <option> tag. I have it working now.
Christopher
Site Administrator
Posts: 13596 Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US
Post
by Christopher » Sun Jun 16, 2013 12:45 am
<option> is a child of <select> so you can either use a <select> or change it to an <input>.
(#10850)
social_experiment
DevNet Master
Posts: 2793 Joined: Sun Feb 15, 2009 11:08 am
Location: .za
Post
by social_experiment » Wed Jun 19, 2013 3:48 am
orbdrums wrote: Any suggestions?
not directly tied to your problem but avoid short tags (<? ?>); instead use <?php ?>
“Don’t worry if it doesn’t work right. If everything did, you’d be out of a job.” - Mosher’s Law of Software Engineering