Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Post New Thread Reply

Register GFY Rules Calendar Mark Forums Read
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed.

 
Thread Tools
Old 12-24-2004, 11:55 AM   #1
kemp
Confirmed User
 
Join Date: Feb 2001
Location: Utopia
Posts: 392
Super Easy PHP question

Why doesn't this work any more? (assuming the code is inside of test.php)

<a href="test.php?table=oral">ORAL</a>

<?
print("$table");
?>

It used to work for me on an older server. But now it says no variable is defined for $table when you click on the ORAL link. WTF?
kemp is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 12-24-2004, 11:55 AM   #2
azguy
Confirmed User
 
Join Date: Nov 2004
Location: Scottsdale, AZ
Posts: 5,167
globals is off. use $_GET["table"] instead
azguy is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 12-24-2004, 11:56 AM   #3
StuartD
Sofa King Band
 
StuartD's Avatar
 
Join Date: Jul 2002
Location: Outside the box
Posts: 29,903
Because on the new server, global variables are probably turned off.

which means that if you pass something in the url, you have to get it like this:
$_GET[table];

and if you pass it in a form, it's like this:
$_POST[table];
StuartD is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 12-24-2004, 11:56 AM   #4
Harmon
( ͡ʘ╭͜ʖ╮͡ʘ)
 
Harmon's Avatar
 
Industry Role:
Join Date: Mar 2004
Posts: 20,010
Correction. This is a "not so easy php question" now isn't it
__________________
[email protected]
Harmon is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 12-24-2004, 11:56 AM   #5
kemp
Confirmed User
 
Join Date: Feb 2001
Location: Utopia
Posts: 392
Thanks azguy - I knew it had to be something incredibly simple
kemp is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 12-24-2004, 11:56 AM   #6
azguy
Confirmed User
 
Join Date: Nov 2004
Location: Scottsdale, AZ
Posts: 5,167
you can also turn on register_globals in your php.ini if you want
azguy is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 12-24-2004, 11:57 AM   #7
fuzebox
making it rain
 
fuzebox's Avatar
 
Industry Role:
Join Date: Oct 2003
Location: seattle
Posts: 22,119
Quote:
Originally Posted by azguy
globals is off. use $_GET["table"] instead
If you're lazy you can also use $_REQUEST if you don't feel like differentiating between _GET and _POST.
fuzebox is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 12-24-2004, 11:57 AM   #8
kemp
Confirmed User
 
Join Date: Feb 2001
Location: Utopia
Posts: 392
Dang, you guys post quick. lol
kemp is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 12-24-2004, 11:58 AM   #9
kemp
Confirmed User
 
Join Date: Feb 2001
Location: Utopia
Posts: 392
Quote:
Originally Posted by fuzebox
If you're lazy you can also use $_REQUEST if you don't feel like differentiating between _GET and _POST.
Is there any speed differences (assuming this page will one day get 500k a day)?
kemp is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 12-24-2004, 11:59 AM   #10
azguy
Confirmed User
 
Join Date: Nov 2004
Location: Scottsdale, AZ
Posts: 5,167
Quote:
Originally Posted by kemp
Is there any speed differences (assuming this page will one day get 500k a day)?
you wouldn't feel it even if there was
azguy is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 12-24-2004, 12:05 PM   #11
dubsix
Confirmed User
 
Industry Role:
Join Date: Dec 2004
Posts: 363
Quote:
Originally Posted by fuzebox
If you're lazy you can also use $_REQUEST if you don't feel like differentiating between _GET and _POST.
I can't believe people still don't know abou register globals... it's been off in php by default for what 1+ year now?
dubsix is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 12-24-2004, 12:07 PM   #12
azguy
Confirmed User
 
Join Date: Nov 2004
Location: Scottsdale, AZ
Posts: 5,167
Quote:
Originally Posted by WireSix-Ryan
I can't believe people still don't know abou register globals... it's been off in php by default for what 1+ year now?
Since v4.2.0, yeah.
azguy is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 12-24-2004, 12:08 PM   #13
StuartD
Sofa King Band
 
StuartD's Avatar
 
Join Date: Jul 2002
Location: Outside the box
Posts: 29,903
Quote:
Originally Posted by WireSix-Ryan
I can't believe people still don't know abou register globals... it's been off in php by default for what 1+ year now?
uhmm... not everyone who deals with php is a programmer... and not all programmers have been working consistantly for years.

There's people out there who don't deal with a bunch of code day in and day out, they don't have to deal with this stuff. That's what diversity is all about.
StuartD is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Post New Thread Reply
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >

Bookmarks
Thread Tools



Advertising inquiries - marketing at gfy dot com

Contact Admin - Advertise - GFY Rules - Top

©2000-, AI Media Network Inc



Powered by vBulletin
Copyright © 2000- Jelsoft Enterprises Limited.