New To Mac-Forums?

Welcome to our community! Join the discussion today by registering your FREE account. If you have any problems with the registration process, please contact us!

Get your questions answered by community gurus • Advice and insight from world-class Apple enthusiasts • Exclusive access to members-only contests, giveaways and deals

Join today!

 
Start a Discussion
 

Mac-Forums Brief

Subscribe to Mac-Forums Brief to receive special offers from Mac-Forums partners and sponsors

Join the conversation RSS
Web Design and Hosting Creating sites, scripting, and hosting discussions.

Php


Post Reply New Thread Subscribe

 
Thread Tools
vtupser
Guest
 
Posts: n/a

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.
QUOTE Thanks
cerberos
Guest
 
Posts: n/a

You probably have register_globals disabled on your local machine.

Instead of reffering to a variable named $qwerty, try $_POST["qwerty"];
QUOTE Thanks
vtupser
Guest
 
Posts: n/a

Thanks, do you know how I would go about changing the register_globals on my machine?
QUOTE Thanks
Murlyn

 
Murlyn's Avatar
 
Member Since: Jun 11, 2003
Location: Mount Vernon, WA
Posts: 4,909
Murlyn is a name known to allMurlyn is a name known to allMurlyn is a name known to allMurlyn is a name known to allMurlyn is a name known to allMurlyn is a name known to allMurlyn is a name known to all
Mac Specs: MacBook Pro 2.6 GHz Core 2 Duo 4GB RAM OS 10.5.2

Murlyn is offline
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.
QUOTE Thanks
vtupser
Guest
 
Posts: n/a

thanks for all the help, it works now
QUOTE Thanks
ryanyogan
Guest
 
Posts: n/a

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!
QUOTE Thanks

Post Reply New Thread Subscribe


« Google Images | .mac »
Thread Tools

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread
Thread Starter
Forum
Replies
Last Post
PHP Help knaggsy Web Design and Hosting 11 10-20-2004 09:53 AM
Is it possible to setup php and databases on pc and mac? knaggsy Web Design and Hosting 7 08-05-2004 06:09 AM
PHP form with html? design2 Web Design and Hosting 19 05-18-2004 05:08 AM
Enabling PHP JGarcia Web Design and Hosting 3 03-05-2004 09:35 PM
Bogus PHP bug on Mac OS X... mark Web Design and Hosting 19 10-03-2003 07:34 PM

All times are GMT -4. The time now is 04:19 AM.

Powered by vBulletin
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
X

Welcome to Mac-Forums.com

Create your username to jump into the discussion!

New members like you have made this community the ultimate source for your Mac since 2003!


(4 digit year)

Already a member?