1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

(Solved) How to turn on GET with Apache?

Discussion in 'Web & Email' started by Puritan, Sep 27, 2003.

Thread Status:
Not open for further replies.
Advertisement
  1. Puritan

    Puritan Thread Starter

    Joined:
    Feb 14, 2001
    Messages:
    242
    Hi, newbie question here... (I posted this in the Other Software forum, but it might be better suited for here... apologies for posting again, but I didn't kno how to move the message)...

    I downloaded an Apache/MySQL/PHP package to develop some PHP, but for some reason, I can't pass any arguments via GET to my php pages. I try to access the variables I'm sending with $_GET["soandso"], but I'm getting nothing; $_GET is an empty array. If I upload my pages to another site, it works properly, so I must have something configured wrong on my server. How to turn this on? Thanks.
     
  2. Shadow2531

    Shadow2531

    Joined:
    Apr 30, 2001
    Messages:
    2,636
    Not sure about the MySQL part, but if you pass variables from one page to the next in php with method=post, then you need to use $HTTP_POST_VARS['variable']
    If you use method=get you use $HTTP_GET_VARS['variable']

    If you want to get all the variables then you use $_SERVER["QUERY_STRING"]
     
  3. Puritan

    Puritan Thread Starter

    Joined:
    Feb 14, 2001
    Messages:
    242
    Well, I read on www.php.net that $HTTP_GET_VARS has deprecated in favor of $_GET, but anyway, that's not my problem. My problem is that on the Apache server (running on XP, if that's relevant) I installed on my personal computer to test my PHP files, I can't access my GET arguments, either through $_GET or through $HTTP_GET_VARS (they're just end up being empty arrays). If I upload my PHP files to the server that they'll eventually be running on, however, they work fine and get their GET arguments with no problem, i.e. it's not a problem with my PHP code but rather a problem with my personal Apache server not passing along the arguments like it should to the PHP files to begin with, or something. There must be some simple setting that I need to turn on to make it work...? Thanks.
     
  4. Shadow2531

    Shadow2531

    Joined:
    Apr 30, 2001
    Messages:
    2,636
    I'm running apache on server 2k3 which is like xp second edition.

    What version of apache and what version of php? (I'm using 4.3.1)

    If you want to see my httpd.conf, I can provide it for you for comparison.

    Or if you need php.ini, I can provide it for you for comparison.

    Can you pass variables with perl with no problem?
    (if you have perl installed)

    Here is basically how I have Apache setup.

    Even though your code is correct, I can give you an example of code that you can try to see if GET works with it.

    $_GET and $_POST both work for me also. (in addition to the deprecated ones)
     
  5. Puritan

    Puritan Thread Starter

    Joined:
    Feb 14, 2001
    Messages:
    242
    Um, Apache 1.3.14, PHP version 4.05. Is this too old? I downloaded a triad package that had Apache, MySql, and PHP in a single package...

    I looked in php.ini, and I think that GET is turned on (at least I didn't see anywhere where it would be turned off), same with httpd.conf, although I'm not sure what entry I should be looking for (I have very little experience setting up a server, even one that no one acccesses but me :)). Hmm... do you know what setting I should look for? Thanks.
     
  6. Shadow2531

    Shadow2531

    Joined:
    Apr 30, 2001
    Messages:
    2,636
  7. Puritan

    Puritan Thread Starter

    Joined:
    Feb 14, 2001
    Messages:
    242
    Hmm, taking your advice about newer versions I uninstalled and reinstalled PHPTriad (which is what I'm using since I didn't want to have to install and configure Apache, PHP, and MySQL separately)... I don't know if it's a newer version or even the same version I had originally installed again (it's a version circa 2002), but now GET has decided to start working again, so that's good enough for me. :) Weirdness. Oh well. Thanks for your help, everyone!
     
  8. Shadow2531

    Shadow2531

    Joined:
    Apr 30, 2001
    Messages:
    2,636
  9. Sponsor

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Loading...
Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/167769

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice