cima_82 Posted September 25, 2007 Share Posted September 25, 2007 Does the way you access values sent through a web form using POST vary from PHP version? i had something like this: <form method = "POST" action = " "> String Input: <input type = "text" name = "t1"> <input type= "submit" value= "ok"> </form> <?php echo "Inupt string: ".$_POST['t1']; ?> nothing got printed to the browser. tried this: <?php echo "Inupt string: ".$_POST[t1]; ?> and it printed the text i entered in the text box. why?? im working on a ubuntu server with PHP5.2.1. i usually accessed the values in the post var using $_POST['varname']. any ideas as to what happened and why? Link to comment https://forums.phpfreaks.com/topic/70549-_post-in-php5/ Share on other sites More sharing options...
ToonMariner Posted September 25, 2007 Share Posted September 25, 2007 nope - you should NOT reference string indexes like that anyway $_POST['t1'] is corrent and while $_POST[t1] may work the php dudes ahev stated that iy shouldn't be used in case they intoduce some kind of config settng that uses that string... $_POST['E_ALL'] and $_POST[E_ALL] is an example.... Link to comment https://forums.phpfreaks.com/topic/70549-_post-in-php5/#findComment-354487 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.