Jump to content

$_POST in PHP5


cima_82

Recommended Posts

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

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.