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
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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.