12-13-2004, 11:45 PM #1vtupserGuestPhp
I have Apache and PHP 5 installed on my Mac and run it as a testing server before uploading to my host site. I have been scripting in PHP for a while, but cant understand why I keep running into this one problem. I have created a form and use the post method to send to a handling page, but when I go to retrieve the variables from the post, they will not show up to be processed. Every other part of PHP shows up (when viewed in a browser) i.e. print function, if then statements, etc, but the variables wont be extracted and be processed. Now for the kicker, when I upload my page to a hosting server and view, everything works fine—variables extracted and all. Any clue why my machine wont pick up the variables? Any help would be great! Thanks.
12-14-2004, 06:49 AM #2cerberosGuest
You probably have register_globals disabled on your local machine.
Instead of reffering to a variable named $qwerty, try $_POST["qwerty"];
12-14-2004, 11:09 AM #3vtupserGuest
Thanks, do you know how I would go about changing the register_globals on my machine?
12-14-2004, 11:58 AM #4
- Member Since
- Jun 11, 2003
- Mount Vernon, WA
- MacBook Pro 2.6 GHz Core 2 Duo 4GB RAM OS 10.5.2
Don't, always use the global vars $_POST, $_GET, $_SERVER, $GLOBALS, etc.. always use those, so that they will be compatible with I believe PHP 4.1x and up, including PHP 5.---> Join the Mac-Forums Folding team: use 37954 as your team number.
View Mac-Forums Folding team statistics (More Info)
Don't forget to use the User Reputation System
12-15-2004, 03:13 PM #5vtupserGuest
thanks for all the help, it works now
02-16-2005, 03:36 AM #6ryanyoganGuest
Yea they tried using globals as the default for a little bit in php4 , however it caused some major issues. They then turned it off by default, if you still find that you want to use this you can turn it on in your php.ini file! It is the near the top, I highly recomend you keep this off, it is just good practice to use $_POST['var'];, or $_HTTP_POST_VARS['var']; the second is becoming obsolete as well!
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
By Yodda_Hunter in forum OS X - Apps and GamesReplies: 4Last Post: 12-30-2013, 10:39 AM
By prplxd in forum OS X - Development and DarwinReplies: 1Last Post: 12-04-2005, 10:57 AM
By JoeyRamoneLives in forum Web Design and HostingReplies: 2Last Post: 04-26-2005, 10:01 PM
By EvoMac in forum Web Design and HostingReplies: 2Last Post: 02-18-2005, 12:38 PM
By knaggsy in forum Web Design and HostingReplies: 11Last Post: 10-20-2004, 09:53 AM