im absolitely new to PHP, and have set it up on my local computer to run with Apache as an SAPI module. Everything works fine, except when processing a form, the page that is loaded to deal with the form data, doesnt seem to be aware of the form values
eg a input names name in my form, should be accessed on my php page as $name, but this doesnt print out any value.
This is only the case on my computer, when i upload it to my server, which allows PHP scrpting, it works fine.
Any suggestions, maybe i havnt installed some modules? if so how do i install them, and which ones?
thanks
M[/b]
new to PHP .....
Moderator: General Moderators
it wrked ! :-D
thanks mate, it worked, and u saved me alot of time crawling round the web looking for a solution! .. so why does it work is the nex natural question!
Because, as you mentioned, you are new, and that would mean you just installed PHP 4.2.
If you read on this page: http://www.php.net/release_4_2_0.php
This part:
You were attempting to access a variable from a Get or Post method, or an external variable (Sessions, Cookies, and such also fall into this category) directly, as a global.
For security purposes, these are disabled. However, you can change that.
All you have to do is edit the php.ini file.
Look for this line:
And switch it with this:
Now, I would recommend doing that, however, I also urge you to use $_GET and $_POST over directly accessing the variable like you were. This is for security reasons and what not.
You can read more about that and the reasons here: http://www.phpadvisory.com/articles/view.phtml?ID=1
Good luck
If you read on this page: http://www.php.net/release_4_2_0.php
This part:
This is where your problem occured.External variables (from the environment, the HTTP request, cookies or the web server) are no longer registered as global variables
You were attempting to access a variable from a Get or Post method, or an external variable (Sessions, Cookies, and such also fall into this category) directly, as a global.
For security purposes, these are disabled. However, you can change that.
All you have to do is edit the php.ini file.
Look for this line:
Code: Select all
register_globals = offCode: Select all
register_globals = onYou can read more about that and the reasons here: http://www.phpadvisory.com/articles/view.phtml?ID=1
Good luck