Forum Moderators: coopster

Message Too Old, No Replies

POSTing to PHP on Windows Server

Is it different?

         

monolift

6:57 pm on Nov 25, 2002 (gmt 0)

10+ Year Member



I am simply trying to POST a form to a PHP script on a Windows server, but the variables don't seem to transfer. I've used the same form on LINUX servers many times and it has always worked fine.

The Windows server is saying that the variables are undefined. Is there anything extra I have to do to the form or the PHP script when they are on a Windows server?

jatar_k

7:34 pm on Nov 25, 2002 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Windows shouldn't have anything to do with it.

Hav you used it on a server with register_globals on previously and now it isn't on? How are you trying to access the posted vars?

Are you using $HTTP_POST_VARS or $_POST? $_POST is only version 4.1.0 and later.

monolift

7:46 pm on Nov 25, 2002 (gmt 0)

10+ Year Member



I just found out that register_globals is off.

Do I have to use sessions now? Or is there away around this?

jatar_k

7:53 pm on Nov 25, 2002 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



depending on version use
$HTTP_POST_VARS or $_POST

$firstname = $HTTP_POST_VARS["firstname"]; or even
$firstname = $HTTP_GET_VARS["firstname"];

get it? If not read here
Predefined Variables [php.net]

monolift

8:08 pm on Nov 25, 2002 (gmt 0)

10+ Year Member



Thank you very much. That worked. I'm sorry if the question was stupid. The UNIX server I usually use has never had register_globals turned off, so I've never had a problem.

jatar_k

8:29 pm on Nov 25, 2002 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



You should know by now monolift that there are no stupid questions.

I had some serious confusion the first time I started porting existing to many different server configs. I usually have a couple verions of most scripts now that depend on server config.

The first thing I do when working with a new server is phpinfo();

That gives me all of the config info and allows me to adjust accordingly.