faqts : Computers : Programming : Languages : PHP

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

7 of 14 people (50%) answered Yes
Recently 6 of 10 people (60%) answered Yes

Entry

PHP 4.2.3 Problem-Why can't I pass variables with set values to another page.php?

Mar 15th, 2008 18:09
ha mo, Justin Dalrymple, Soheil Callage,


PHP is now defaulted to turn-off "register_globals". Sounds to me like
you need to turn it on in your php.ini file...
register_globals = On
Nowadays, PHP groups your GET/POST parameters into the $_REQUEST array.
Try running a script like so;
<?php
phpinfo();
?>
Check to see if register_globals is off. If so, turn it on with the
information above.
If you wish to keep it off, example:
URL:
http://localhost/index.php?name=Justin
SCRIPT:
<?php
echo ($name);
?>
To make this work without register_globals you would need to do this:
<?php
echo ($_REQUEST[name]);
?>
http://www.tantofa.com
http://www.fantofa.com
http://www.mantofa.com
http://www.tanpola.com
http://www.tampola.com
http://www.mozmar.com
http://www.yamot.com
http://www.templatestemp.com