Basic registration form for Signup-PHP
Learn How to Develope Basic registration form for Signup in PHP and HTML
In this article we are going to learn how to create a basic registration
form and connect with PHP. Generally the registration form method is
always 'post'. Post method will submit the user data in a secured
manner. To read
from post data PHP uses $_POST inbuilt array. The below example lets
you know how to read data from various types of form controls and print
it in PHP.
registration-form.php
<!doctype html>
<html lang="en">
<head>
<title>e-trainings Demo - creating registration form using PHP,HTML</title>
<meta charset="utf-8">
</head>
<body>
<?php
if(isset($_POST['submit'])) {
print "<h2>Your details are as follows :</h2><br>";
echo "username: " . $_POST['user'] . "<br />";
echo "password: " . $_POST['pwd'] . "<br />";
print "Gender:".($_POST['gender'])."<br>";
print "Qualification:".($_POST['qualification'])."<br>";
$langs=$_POST['lang'];
print "<br> Spoken Languages :<br>";
foreach($langs as $lang)
{
print $lang."<br>";
}
print "About your self :".($_POST['aboutyou'])."<br>";
}
?>
<form name="regi-form" action="" method="post" >
<center>
<h2>Basic Signup Form Creation with PHP and HTML</h2>
</center>
Username <input type="text" name="user"><br />
Password <input type="password" name="pwd"><br /><br />
Gender:
<input type="radio" value="Male" name="gender" checked /> Male
<input type="radio" value="Female" name="gender" />Female<br><br>
Qualification:
<select name="qualification" >
<option>Degree</option>
<option>Masters</option>
<option>Engineering</option>
<option>Deploma</option>
</select>
<br><br>
Spoken Languages:<br>
<input type="checkbox" value="english" name="lang[]" />English<br>
<input type="checkbox" value="hindi" name="lang[]" />Hindi<br>
<input type="checkbox" value="french" name="lang[]" />French<br>
<input type="checkbox" value="german" name="lang[]" />German<br><br>
AboutYou:<br>
<textarea rows=5 cols=50 name="aboutyou" />
</textarea><br><br>
<input type="submit" value="Submit" name="submit" />
<input type="reset" value="Reset" name="reset" />
</form>
</body>
</html>
Preview output:
Next FileUploding in PHP
Comments
Post a Comment