passing variables

Ask about general coding issues or problems here.

Moderators: egami, macek, gesf

Post Reply
php-forum Active User
php-forum Active User
Posts: 264
Joined: Tue Apr 08, 2003 5:18 am
Location: Ottawa, Canada

Fri Apr 09, 2004 7:27 am

the page that you are calling should be using $_GET['temp'] to access the value and not just $temp

User avatar
Posts: 1716
Joined: Sun Dec 29, 2002 5:03 am
Location: Portugal / Sweden

Fri Apr 09, 2004 8:47 am

The problem is called register_globals and it seems to be set to off in your new server!

In all new versions of PHP the register global setting is default set to off (earlier it was on). That forces people to write a bit more secure scripts.

What this means when coding is that you need to use some supergloabls arrays when you want access certain variables.

If you send some variables from a form using the post or get method then to access those variables on the test.php page you need to use the $_POST or $_GET array. The same goes for getting variables from the url, but then you need to use the $_GET array.
All the different arrays are listed in the link above.

Here is a function that may help you!
Gonçalo "gesf" Fontoura

Post Reply