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.

MAMP: PHP can't catch HTTP variables


Post Reply New Thread Subscribe

 
Thread Tools
komo
Guest
 
Posts: n/a

right now i have a little projects using PHP and MySQL, using MAMP as a development framework on my iBook.
it worked fine to test php scripts and manipulating MySQL databases. but, as the project went on, i found a small but very annoying glitch on my MAMP. whenever i tried to pass HTTP variables, whether using Get or Post methods, the PHP scripts could never catch them.

at first i thought it's just an error on my scripts, but those same scripts works well when i tested them on my Windows machine (using AppServ), so I thought it must be a problem with some configurations, not with my scripts

is there somehow any configurations needed on MAMP that cause my problem??

thx upfront.
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
Are you using these variables?

$_POST, $_GET, $_REQUEST, $_SERVER etc? Sometimes people use the old way of coding using register_globals turned on.. which is a no no
QUOTE Thanks
komo
Guest
 
Posts: n/a

no, i used $<variable-name> e.g. $myvar
do i really have to use those old ways?? i kinda hate it, not practical at all..
QUOTE Thanks
sarahsboy18

 
sarahsboy18's Avatar
 
Member Since: Jan 30, 2005
Location: Fort Worth, Texas
Posts: 1,069
sarahsboy18 is just really nicesarahsboy18 is just really nicesarahsboy18 is just really nicesarahsboy18 is just really nice
Mac Specs: Mac Pro, 8-Core 2.8Ghz, 10GB RAM, 2x1TB HDDs, iPod U2 Edition

sarahsboy18 is offline
Yeah, Sounds like you don't have register globals turned on... You can turn it on in the php.ini file in the conf directory in MAMP. But like Murlyn said if you plan to put this on a live server it is a major security risk.

If you are concerned about putting the $_POST in each line the best way to handle this is to assign all of your variables at the front of the script or even in a seperate include... e.g. $_POST['var1'] = $var1

Just make sure you include them in the header of each function you write as the will not carry otherwise.

"If you had a friend who was a tightrope walker, and you were walking down a sidewalk, and he fell, that would be completely unacceptable." -Mitch Hedberg
QUOTE Thanks
komo
Guest
 
Posts: n/a

wow, thanks a lot, i never thought to put an "alias" for HTTP variables, but for now i think i'll stick with global variables. it's just for another school assignment
thanks again...
QUOTE Thanks

Post Reply New Thread Subscribe


« new to mac + web developement | what's a good wysiwig html editor »
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
Setting up PHP and PHP Nuke EvoMac Web Design and Hosting 2 02-18-2005 01:38 PM
Php vtupser Web Design and Hosting 5 02-16-2005 04:36 AM

All times are GMT -4. The time now is 12:55 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?