Forum Moderators: coopster

Message Too Old, No Replies

FORM variable do not follow to next page

Problem with FORM variables on Mandrake Linux

         

Montbazin

9:38 pm on Jul 19, 2005 (gmt 0)

10+ Year Member



I have installed PHP and MySQL on my Mandrake 9.1 platform. Now i tried to test some of my PHP scripts and MySQL requests. The work all fine. Bot whe I use a form:

<form action="next-page.php" method="post">
<input type="text" name="myvariable" value="something">
<input type="submit" value="Click">

it will send me to

next-page.php
but the variable
$myvariable
will remain empty.

Can somebody help me out on this?

Thanks

sned

9:43 pm on Jul 19, 2005 (gmt 0)

10+ Year Member



Have you tried accessing it on your next-page.php file like this:

$myvariable = $_POST['myvariable'];

-sned

Montbazin

10:09 pm on Jul 19, 2005 (gmt 0)

10+ Year Member



thanks sned

it worked. how come that the other way without

 $_POST
always worked fine on several servers where I have my websites hosted.
Has something to be changed on the PHP configuration on my local Linux machine and will this work in any case if I modify this on my websites. I mean will it be more appropriate?

tanks
roberto (montbazin)

sned

10:19 pm on Jul 19, 2005 (gmt 0)

10+ Year Member



It is a php configuration thing, see register_globals [us3.php.net].

When it is turned on, you can access form variables the way you mentioned in the first post. When it is turned off, you have to use the GET and POST arrays --- $_GET['somevar'], $_POST['somevar'], $_SESSION['somevar'], etc.

-sned

Montbazin

10:23 pm on Jul 19, 2005 (gmt 0)

10+ Year Member



thanks again
this is of great help for me.
do you know what the path to the PHP configuration file is, sorry I even don't know what this file is called. I only know I can read it with "phpinfo()"

sned

10:31 pm on Jul 19, 2005 (gmt 0)

10+ Year Member



The file is usually called php.ini, I'm not sure where you would find it at, on my server, its at /etc/php.ini

-sned

Montbazin

10:33 pm on Jul 19, 2005 (gmt 0)

10+ Year Member



super

thanks a lot, best wishes from Montbazin in France...
roberto