PHP HTML Form Input Example
make a file “php-html-form-input-example.php" then copy & paste blow code.
php-html-form-input-example.php
<?php
if(isset($_POST['BtnSubmit']))
{
echo "<h2>Form Submitted Successfully!! Bellow is the data</h2>";
echo "<hr>";
echo "</br>Your Name :{$_POST['Fullname']}";
echo "</br>Your Age :{$_POST['UserAge']}";
echo "<hr>";
}
?>
<h2>PHP HTML Form Input Example</h2>
<form name="UserInformationForm" method="POST" action="#">
Enter Your Full Name :
<input name="Fullname" type="text" value="<?php echo $_POST['Fullname']; ?>"><br/><br/>
Enter Your Age :
<input name="UserAge" type="text" value="<?php echo $_POST['UserAge']; ?>"><br/><br/>
<input name="BtnSubmit" type="submit" value="Submit">
</form>
Fire-up your favorite browser to see the effect of a blank HTML form with input box in PHP "http://localhost/html/php-html-form-input-example.php". Browser output should look like as follows:
Now fill-up the HTML form and get submitted data in PHP "http://localhost/html/php-html-form-input-example.php". Browser output should look like as follows:
Related Tutorial Examples
- PHP HTML Form textarea Example
- PHP HTML Form radio button Example
- HTML Form Example in PHP
- 20 steps to make CakePHP Blog Project
- MySQL isnull() Function Example
- MySQL least() Function Datetime Value Example
- MySQL sample database script: Create Database using SQL Statement Example
- MySQL Sub-Query: INSERT INTO SELECT... Example
- SELECT all rows of a Table using SQL Command MySQL Example
- PERL Example: Use of Multidimentional Array in PERL


No comments:
Post a Comment
leave your comments here..