Asked by
Birds of the sky (2 Golds)
Thursday, 30 Dec 2021, 07:05 AM
at (Technology
Computer)
|
|
|
|
logout.php file <?php include_once 'config.php'; ?> <a href="index.php"> Add Data </a> <br> <a href="login.php"> Log In Data </a> <br> <a href="logout.php"> Log Out </a> <br> <?php if(session_destroy()) { echo 'Logged Out Successfully! '; } ?> |
Answered by
Birds of the sky (2 Golds)
Thursday, 30 Dec 2021, 07:10 AM
|
action.php (Data is inserted by this page) <?php include_once 'config.php'; ?> <a href="index.php"> Add Data </a> <br> <a href="login.php"> Log In Data </a> <br> <a href="logout.php"> Log Out </a> <br> <?php if (isset($_POST['submit']) & !empty($_POST['submit'])) { $sql = "INSERT INTO test(name, password, dob) VALUES('$_POST[name]', '$_POST[password]', '$_POST[dob]')"; if (mysqli_query($conn, $sql)) { echo 'Data Inserted Successfully! '; } } Answered by Birds of the sky (2 Golds) Thursday, 30 Dec 2021, 07:09 AM |
index.php file <?php include_once 'config.php'; ?> <html> <head> <title> PHP LOG IN FORM </title> </head> <body>
<a href="index.php"> Add Data </a> <br> <a href="login.php"> Log In Data </a> <br> <a href="logout.php"> Log Out </a> <br>
<h2> Add Data into Database </h2> <form method="POST" action="action.php" enctype="multipart/form-data"> <input type="text" name = "name" placeholder="Enter Name"/> <input type="password" name = "password" placeholder="Enter Password"/> <input type="date" name="dob"/> <input type="submit" name="submit" value="Add Data"/> </form> <br> <br> </body> </html> <?php ?> Answered by Birds of the sky (2 Golds) Thursday, 30 Dec 2021, 07:09 AM |
Answered by
Birds of the sky (2 Golds)
Thursday, 30 Dec 2021, 07:08 AM
|
PHP login form creation is very easy. Just copy and paste this on your IDE (Ex: Netbeans...) and XAMPP , MYSQL etc and get output. Thanks. Answered by Birds of the sky (2 Golds) Thursday, 30 Dec 2021, 07:06 AM |