HTML Form Example in PHP
make a file “html-form-in-php.php" then copy & paste blow code.
html-form-in-php.php
<?php
if(isset($_POST['BtnSubmit']))
{
echo "<h3>Form Submitted Successfully!! </h3>";
echo "Submitted Data Array As Bellow: <br/>";
print_r($_POST);
}
?>
<h2>HTML Login Form Example in PHP</h2>
<form name="LoginForm" method="POST" action="#">
Username :
<input name="Username" type="text" value="<?php echo $_POST['Username']; ?>"><br/><br/>
Password :
<input name="Password" type="password" value="<?php echo $_POST['Password']; ?>"><br/><br/>
<input name="BtnSubmit" type="submit" value="Login">
</form>
Fire-up your favorite browser to see the effect of a blank HTML form in PHP "http://localhost/blog/html-form-in-php.php". Browser output should look like as follows:
Now fill-up the HTML form and get submitted data in PHP "http://localhost/blog/html-form-in-php.php". Browser output should look like as follows:
Related Tutorial Examples
- PHP HTML Form Input Example
- PHP HTML Form textarea Example
- PHP HTML Form radio button Example
- PHP HTML Form select box Example
- 20 steps to make CakePHP Blog Project
- MySQL greatest() Function Datetime Example
- MySQL now() Datetime Function Example
- MySQL Stored Procedure: Creating Table using Stored Procedure Example
- SELECT specific row(s) of a Table using SQL Command MySQL Example
- PERL Example: Hellow world! program in PERL


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