ONJava.com -- The Independent Source for Enterprise Java
oreilly.comSafari Books Online.Conferences.

advertisement

AddThis Social Bookmark Button
Article:
  PHP Form Handling
Subject:   PHP
Date:   2009-05-08 09:46:25
From:   UTHUMI
HI
I AM RAM
i BEGINER.
<body>
<form action="<?php echo $_SERVER['PHP_SELF'];?>" method="post" target="_blank" >

First Name :<input type="text" size="12" maxlength="12" name="Fname">

Last Name :<input type="text" size="12" maxlength="36" name="Lname">

Gender ::

Male :<input type="radio" value="Male" name="gender">

Female :<input type="radio" value="Female" name="gender">

Please choose type of residence::

Steak :<input type="checkbox" value="Steak" name="food[]">

Pizza :<input type="checkbox" value="Pizza" name="food[]">

Chicken :<input type="checkbox" value="Chicken" name="food[]">

<textarea rows="5" cols="20" name="quote" wrap="physical">Enter your favorite quote!</textarea>

Select a Level of Education:

<select name= "education">
<option value= "Jr.High" selected>Jr.High</option>
<option value="HighSchool">HighSchool</option>
<option value="College">College</option></select>:

Select your favorite time of day::

<select name="TofD" size="3">
<option value="Morning">Morning</option>
<option value="Day">Day</option>
<option value="Night">Night</option></select>:

<input type="submit" value="submit" name="send">

</form>
</body>
<?php
if(isset($_POST['send']))
{
echo "Accessing Firstname : " . $_POST['Fname'] . "<br>";
echo "Accessing Lastname : " . $_POST['Lname'] . "
";

echo "gender " . $_POST ['gender']. "
";
echo "food " . $_POST ['food']. "
";
echo "education " . $_POST ['education']. "
";
echo "TofD" . $_POST ['TofD']. "
";
echo "quote" . $_POST ['quote']. "
";

}
?>
IF RUN THIS PAGE BUT I GOT THIS
http://localhost/FORMS/<?php%20echo%20$_SERVER['PHP_SELF'];?>
(HTTP Error 403 - Forbidden )
PLS HELP ME...
THANK U

1 to 1 of 1
1 to 1 of 1