Re: [NEWBIE] Cant get $_POST to work

From: Date: Sun, 20 Feb 2005 21:39:33 +0000
Subject: Re: [NEWBIE] Cant get $_POST to work
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-209090@lists.php.net to get a copy of this message
What's up David... This script *should* work... I don't see any errors, but try this anyways. In your change your print command to this: print("Hello, " . $name . "! You are " . $age . " years old!"); What those periods do is simply append them to each other, so in this case, you have the string, then you're appending the variable, then appending another string, then another variable, then the last string. Instead of having it all bunched up. David Freedman wrote:
I have this simple form file: <html> <head> </head> <body> <form action="test.php" method="post"> Name: <input type="text" name="name" value="your name" /><br/> Age: <input type="text" name="age" value="your age" /><br/> <input type="submit" name="submit" value="submit" /> </form> </body> </html> Which passes (I wish!) data to this script: <?php $name = $_POST['name'] ; $age = $_POST['age'] ; print("Hello, $name! You are $age years old!"); ?> It does not work unless I turn register_globals ON in the php.ini file. The php documentation leads me to believe this script SHOULD work with register_globals OFF. This a NEW instasllation of the Windows IIS Server also. Is there perhaps some configuration on the WINDOWS SERVER that must be set for general global data to be passed from a 'form' type page? David F.


« previous php.general (#209090) next »