RE: [PHP] html input and php (newbie)

From: Date: Tue, 24 Sep 2002 19:32:42 +0000
Subject: RE: [PHP] html input and php (newbie)
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-117465@lists.php.net to get a copy of this message
Hi Anna, Your REGISTER_GLOBALS is most probably set to OFF (see php.ini file). Try using the special $_POST array created by PHP: if ($_POST['submit'] == "click"){ echo "Hello, $_POST[UserName]"; } If your form was using the GET method you would need the $_GET array. Regards, Daniel Kushner _________________________________________ Need hosting? http://thehostingcompany.us > -----Original Message----- > From: Anna Gyor [mailto:bali1a@freemail.hu] > Sent: Tuesday, September 24, 2002 3:31 PM > To: php-general@lists.php.net > Subject: [PHP] html input and php (newbie) > > > Hi, > > I just began to learn php and I have te following code. How can I get the > input field value in the php script? Because my script doesn't work. > $UserName is always an empty string. > > <?php > if ($submit == "click"){ > echo "Hello, $UserName"; > } > else{ > ?> > <html><body> > > <form method="post" action="input.php3"> > > Enter Your Name > <input type="text" name="UserName"></input><br> > > <input type="submit" name="submit" > value="click"></input> > <? echo "Hello, $UserName"; ?> > </form> > > </body></html> > <? > } > > ?> > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >

« previous php.general (#117465) next »