<!DOCTYPE html>
<html>
<head>
<title>signup</title>
</head>
<body>
<form action="process.php" method="POST">
<h1>Sign Up</h1>
<p>Please fill in this form to create an account.</p>
<hr>
<label for="firstname"><b>First Name</b></label>
<input type="text" placeholder="Enter First Name" name="firstname" required>
<label for="email"><b>Email</b></label>
<input type="text" placeholder="Enter Email" name="email" required>
<label for="psw"><b>Password</b></label>
<input type="password" placeholder="Enter Password" name="psw" required>
<button type="submit" class="signupbtn">Sign Up</button>
</form>
</body>
</html>
Step .02
To run PHP, you need to install a Web Server like Apache and you also need a database server like MySQL. There are various web servers for running PHP programs like WAMP & XAMPP. WAMP server is supported in windows and XAMPP is supported in both Windows and Linux
Step .03
connection.php (Make a New PHP File)
Before we can access to the MySQL database, we need to be able to connect to
the server:
/*
What is POST method in PHP?
PHP $_POST is a PHP super global variable which is used to collect form data after submitting an HTML form with method="POST".
$_POST is also widely used to pass variables.
*/
Step .04
Let's Create The Database
How to Create a New Database in phpMyAdmin?
Step .05
process.php (Make a New PHP File )
<?phpinclude 'connection.php';
$name =$_POST["firstname"];$email =$_POST["email"];$password =$_POST["psw"];
$sql = "INSERT INTO `day1` ( `name` , `email` , `password`)VALUES ('".$name."', '".$email."', '".$password."')";
if ($conn->query($sql) === TRUE) {// echo "New record created successfully"; echo "Hello $name";
} else { echo "Error: " . $sql . "<br>" . $conn->error;}
Step .06
if (you are a programming lover){
Subscribe! Apaldsoft Youtube Channel ;
Comment! ;
Share! ;
}else {
Be a Lover ; // &
Subscribe! Apaldsoft Youtube Channel ;
Comment! ;
Share! ;
} 😉

Comments