Sunday, 5 May 2019

Registration form or page system using PHP with MYSQL database volume 1

INDEX.PHP

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title></title>
<link rel="stylesheet" href="">
</head>
<body>
<h1 align="center">REGISTRATION FORM</h1>

<form action="register.php" method="post">
<center>
<table>
<tr><th colspan="2" align="center">fill this registration form</th></tr>
<tr><td>Name:</td> <td><input type="text" placeholder="enter name here" name="name" required=""></td></tr>
<tr><td>Email:</td> <td><input type="email" placeholder="enter email here" name="email" required=""></td></tr>
<tr><td>Password:</td> <td><input type="password" placeholder="enter password here" name="password" required=""></td></tr>
<tr><td colspan="2" align="center"><input type="submit"  value="submit" name="submit" ></td></tr>


</table>
</center>

</form>
</body>
</html>


REGISTER.PHP(  PHP CODE  )


<?php

$con = mysqli_connect("localhost","root","","knowledge");


if (isset($_POST['submit'])) {
$name = $_POST['name'];
$email = $_POST['email'];
$password = $_POST['password'];

$query = "insert into reg(name,email,password) values('$name','$email','$password')";
$run = mysqli_query($con,$query);
if($run){


echo "<script>alert('data inserted successfully')</script>";
header('location:home.php');
}
}
?>

HOME.PHP


<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title></title>
<link rel="stylesheet" href="">
</head>
<body>

<h2 align="center">WELCOME TO MY ALL SUBSCRIBERS!</h2>
<h3 align="center">LIKE....COMMENT...SHARE</h3>
<h1 align="center">SUBSCRIBE MY CHANNEL</h1>

<a href="index.php"><input type="button" value="<<back"></a>

</body>

</html>



No comments:

Post a Comment

The 10 best websites you've probably never heard & you should have to visit !

1.   codepen.io/akm2/full/rHIsa       Start having fun with gravity and say goodbye to your evening. And your job. 2.   co...