Re: HTML Get POST forms

From: Date: Tue, 09 Jul 2002 03:19:04 +0000
Subject: Re: HTML Get POST forms
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-106210@lists.php.net to get a copy of this message
Varsha Agarwal said: > Hi, > I want to create a simple form and reteive the data > and print it. I have done the following in Foo.php. > > <form action="foo.php" method="post"> > *Name: <input type="text" name="username"><br> > *Email : <input type="text" name="email"><br> > <input type="submit" name="submit" value="Submit > me!"> > </form> > Note: * fields are necessary. > <?php > print $_POST[ 'username' ]; > print $_REQUEST[ 'username' ]; > > import_request_variables( 'p', 'p_' ); > print $p_username; > ?> > > The browser gives me error that undefined index > 'usename'. Can anyone tell me what could be wrong as i > am very new to HTML and PHP. What version of php are you using? If it's pre v4.1.X then $_POST is not available and you should use $HTTP_POST_VARS instead. But the best thing to do is to upgrade to v4.2.1. -- Jason Wong -> Gremlins Associates -> www.gremlins.com.hk

« previous php.general (#106210) next »