PHP Registration Form

Rating: 7
Comments: 2

PHP Registration Form

14 Sep 2017 07:29

When you login into a website or into your mail box, you are interacting with a form.

Forms are used to get input from the user and submit it to the web server for processing.

Learn PHP Registration Form using GET, POST Methods with Example and code.

<title>Registration Form</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<?php if (isset($_POST['form_submitted'])): ?> //this code is executed when the form is submitted 
<h2>Thank You 
<?php echo $_POST['firstname']; ?>
<p>You have been registered as <?php echo $_POST['firstname'] . ' ' . $_POST['lastname']; ?> </p> 
<p>Go <a href="/registration_form.php" >back</a> to the form</p> 
<?php else: ?> 
<h2>Registration Form</h2> 
<form action="registration_form.php" method="POST"> 
First name: <input type="text" name="firstname"><br> 
Last name: <input type="text" name="lastname"> <br> 
<input type="hidden" name="form_submitted" value="1"/> 
<input type="submit" value="Submit"> 
<?php endif; ? > 

View the Demo:
Original URL:
License Info:

rating: +7+x

Add a New Comment
Copyright © 2011-2019 Icon Deposit - All rights Reserved