Find the answer to your Linux question:
Results 1 to 3 of 3
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    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

  2. #2
    Just Joined!
    Join Date
    May 2004
    its a php.ini value.

    I believe its called


    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

  3. #3
    Well, that did not work, setting registered_globals=on that is.

    But I did write a php script:

    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

  4. $spacer_open

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts