faqts : Computers : Programming : Languages : PHP

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

27 of 32 people (84%) answered Yes
Recently 8 of 10 people (80%) answered Yes

Entry

When I process a form by a .php file, the variables from the form are not availbale in the .php file

Mar 1st, 2008 06:47
dman, Tim Parkinson, az az, http://www.ttnr.org


Since PHP 4.0.3 the track_vars configuration directive has been turned 
off by default. This is a security measure to stop people setting 
random vars by simply passing them in the URL string. If you didn't 
implicitly set a variable within your script this could cause problems. 
For this reason I would leave track_vars turned off.
The way to access the form variables is by the arrays $_GET and $_POST 
depending on what your form is using. So if you have a text input 
called name in your form, just do:
$name = $_POST['name']; 
To access it.