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 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php