Click here to Skip to main content
15,905,028 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi thiis is vijayadurga, I am a beginner of PHP,I downloaded one php file,but i put it wampserver, i got an error, The error is "register_globals is disabled in php.ini, please enable it!"
Please give solution how to solve this problem
Posted
Comments
[no name] 2-Jul-12 22:58pm    
http://forums.oscommerce.com/topic/264969-fatal-error-register-globals-is-disabled-in-phpini-please-enable-it/

You might want to consider showing some appreciation to the people that have been answering your questions.

1 solution

It is a way better practice if we use do not use register_globals. If you try to avoid this error you will have to go through lots of change. though you are beginner which mean you are learning. I would suggest you to remove the line from your php code.

now what does it do:
Say you have a from with two input field name and age. when you submit and if your register_globals function is called your php will create two variable name: $name, $age and will set the value from the form field. example:

PHP
<form method="get">
<input name="name">
<input name="age">
<input type="submit">
</input></input></input></form>


you will also get a variable name $submit

now what's wrong with this:
a request can come in two way :
1. POST Method
2. GET Method
in both case register_globals will create variabls. but you would never know how it came. is this a problem? in cases it is. but read more you will get more problem

Register_globals also register $_SESSION, $_COOKIE, $_HEADER, $_ENV

So perhaps your data will easily be overlapped with other data. Actually one data will be lost.

what would you use instead of register_globals?
$_GET for get method
$_POST for post method
$_SESSION for session data; it also has other related function
$_COOKIE for cookie data; it also has other related function
$_HEADER for header data
$_ENV for environment related data
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900