Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

FattyMembrane

macrumors 6502a
Original poster
i just enabled PHP on my installation of 10.3 and although it works, it will not process variables passed in the location bar. for example, if my site index.php has a link to href="index.php?option=2"

Code:
mycomp.local/index.php?option=2

refreshes, but the page stays exactly the same, option=2 is not processed. if i upload the files to my webserver, everything works fine. as you can imagine, this is crippling my sites, and makes my built-in webserver pretty close to useless. any help would be appreciated.
 
Knox is right. try running the following script from both your local server and your live server:
PHP:
<? phpinfo(); ?>

you should see a line in the output that looks like the screen-grab i've attached. if your local server says "Off" and your live server says "On," then there's your problem. register_globals Off, by the way, is the recommended way to run your scripts.
 

Attachments

  • reg_glob.gif
    reg_glob.gif
    1.7 KB · Views: 119
sonofslim said:
Knox is right. try running the following script from both your local server and your live server:
PHP:
<? phpinfo(); ?>

you should see a line in the output that looks like the screen-grab i've attached. if your local server says "Off" and your live server says "On," then there's your problem. register_globals Off, by the way, is the recommended way to run your scripts.
yeah, turn the Register Global Variables to "On" rather than "Off" by default in the php.ini
 
msharp said:
yeah, turn the Register Global Variables to "On" rather than "Off" by default in the php.ini

if you want to mirror your live server's behavior exactly, that is. for discussion on why you might want to leave it off, see the following threads. in a nutshell, writing your scripts under the assumption that register_globals is off is more secure. plus they'll work exactly the same as if register_globals is on, so there's no reason not to.

https://forums.macrumors.com/threads/63196/
https://forums.macrumors.com/threads/50823/
https://forums.macrumors.com/threads/61406/
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.