Results 1 to 3 of 3
I have no idea what to call this problem, so I have no idea what to look for in documentation and such. Perhaps you can point me into right direction, ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 01-16-2005 #1Just Joined!
- Join Date
- Jul 2004
- Posts
- 85
Apache and PHP veriabule variables _GET and _POST
I have no idea what to call this problem, so I have no idea what to look for in documentation and such. Perhaps you can point me into right direction, I am sure it is a PHP config problem but have no idea what to call it.
For instance on my old server a php script like this:
test.php :
<?php echo $p; ?>
if I was to call it like this from web browser: test.php?p=testing
it would printout 'testing'
But on my Slackware default install of Apache and PHP the same script returns nothing because it does not see the $p value pest through get in the browser. However it would have no problam reading $_GET['p']. So... how can I get php to automatically import the values from _GET and _POST arrays in to variables? I mean is there a setting that will do that. I do not mean the php code that would do that. I have alot of code written with a assumption that php would import the variables automatically, it would be a pain to rewrite it
Thank you,
- Bogdan
- 01-16-2005 #2Just Joined!
- Join Date
- May 2004
- Location
- Pennsylvania
- Posts
- 98
its a php.ini value.
I believe its called
registered_globals
make sure its set to 'on' and restart apache
In the documentation for this variable you will see that it urges you to write code so that this parameter does not need to be set.
The php.ini file should be in /etc
- 01-16-2005 #3Just Joined!
- Join Date
- Jul 2004
- Posts
- 85
Well, that did not work, setting registered_globals=on that is.
But I did write a php script:
<?php
foreach ($_GET as $key => $value){
$add = $key;
$$add = $value;
}
foreach ($_POST as $key => $value){
$add = $key;
$$add = $value;
}
?>
and set it as a value for auto_prepend_file and it seams to work just fine.
Do you think that is more or less secure? I am the only one with access to the server.
- Bogdan


Reply With Quote
