Re: values out of form variables

From: Date: Sat, 22 Feb 2003 13:11:32 +0000
Subject: Re: values out of form variables
References: 1  Groups: php.install 
Request: Send a blank email to php-install+get-10149@lists.php.net to get a copy of this message
Hello Mihir. This is Takeo Achiwa from Tokyo,Japan. "Mihir Dhond" <mihir.dhond@i-u.de> wrote > I have the latest version of PHP 4.3.0-win32 (the latest stable version) and > version 1.3.27 of Apache installed. I have a windows XP operating system The > normal php scripts are working fine but when it comes to pulling out > variable values out of a form, it just doesn't work..I worked very hard to > get rid of this problem, but in vain. I run php as a server module. > I also tried enabling the register_globals in the php.ini file but that did > not help. I also tried various browsers like internet explorer and > Mozilla...but the problems remains...I would be very grateful if someone > could help me as fast as possible on this, because without form variables I > am just not able to proceed... > > I am giving a very simple code that I used... > > A basic html file.. calling a php script: > > <form action="welcome.php" method="get"> > First Name: <input type="text" name="firstname" /><br /> > Last Name: <input type="text" name="lastname" /><br /> > <input type="submit" value="GO" /> > </form> > > code in welcome.php: > > <?php > echo( "Welcome to my Website, $firstname $lastname!" ); > ?> > > I have already uninstalled and reinstalled both, the apache server and the > PHP.... > > Hope to get some help on this... > > Mihir Dhond > > I hope the following php coding named welcome.php may help you. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head> <title>WELCOME_MESSAGE</title> </head> <body> <form action="welcome.php" method="get"> First Name: <input type="text" name="firstname" /><br /> Last Name: <input type="text" name="lastname" /><br /> <input type="submit" value="GO" /> </form> <?php $firstname=$_GET[firstname]; $lastname=$_GET[lastname]; echo( "Welcome to my Website, $firstname $lastname!" ); ?> </body> </html>

« previous php.install (#10149) next »