![]() |
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? |
globals is off. use $_GET["table"] instead
|
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]; |
Correction. This is a "not so easy php question" now isn't it :zzwhip
|
Thanks azguy - I knew it had to be something incredibly simple
|
you can also turn on register_globals in your php.ini if you want
|
Quote:
|
Dang, you guys post quick. lol
|
Quote:
|
Quote:
|
Quote:
|
Quote:
|
Quote:
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. |
All times are GMT -7. The time now is 09:49 PM. |
Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123