0
7.1kviews
Write a program to accept username and password field from user in form, store and display it using PHP-MySQL.
1 Answer
| written 7.3 years ago by | • modified 7.2 years ago |
<!DOCTYPE html>
<html>
<head>
<title>PHP Form</title>
</head>
<body>
<?php
if(isset($_POST['submit'])) {
$servername = "localhost";
$username = "username";
$password = "password";
$dbname = "myDB";
// Create connection
$conn = mysqli_connect($servername, $username, $password, $dbname);
// Check connection
if (!$conn) {
die("Connection failed: " . mysqli_connect_error());
}
// sql to create table
$sql …