Untitled
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Sign Up</title> <link rel="stylesheet" href="styles.css"> </head> <body> <div class="container"> <h1>Sign Up</h1> <form action="connect.php" method="post"> <label for="name">Name:</label> <input type="text" id="name" name="name" name="name" required> <label for="dob">Date of Birth:</label> <input type="date" id="dob" name="dob" name="dateofbirth" required> <label for="address">Address:</label> <textarea id="address" name="address" rows="4" name="address" required></textarea> <label for="phone">Phone Number:</label> <input type="tel" id="phone" name="phone" name="phoneno."required> <label for="mail">Email:</label> <input type="email" id="mail" name="mail" name="email" required> <label for="password">Password:</label> <input type="password" id="password" name="password" name="password"required> <button type="submit">Sign Up</button> </form> </div> </body> </html> <?php $name=$_POST['name']; $dateofbirth=$_POST['dateofbirth']; $address=$_POST['address']; $phoneno=$_POST['phoneno']; $email=$_POST['email']; $possword=$_POST['password']; $host="localhost"; $dbusername="root"; $dbpassword=""; $dbname="sign details"; $conn=new mysqli( $host, $dbusername,$dbpassword,$dbname); if($conn->connect_error){ die('connection failed:' .$conn->connect_error); } else{ $stmt=$conn->perpare("insert into registration(name ,datofbirth ,address ,phoneno ,email ,password) values(?, ?, ?, ?, ?,?)"); $stmt->bind_param("sisiss",$name,$dateofbirth,$address,$phoneno,$email,$password); echo "you have successfully created your account....thank you"; $stmt->close(); $conn->cose(); } ?> body { font-family: Arial, sans-serif; background-color: #000; color: #fff; margin: 0; padding: 0; display: flex; justify-content: center; align-items: center; height: 100vh; } .container { background-color: #fff; color: #000; padding: 20px; border-radius: 8px; width: 100%; max-width: 400px; } h1 { text-align: center; margin-bottom: 20px; } form { display: flex; flex-direction: column; } label { margin-bottom: 8px; font-weight: bold; } input[type="text"], input[type="date"], input[type="tel"], input[type="email"], input[type="password"], textarea { width: calc(100% - 20px); padding: 10px; margin-bottom: 20px; border: 1px solid #ccc; border-radius: 4px; font-size: 16px; } textarea { resize: vertical; } button { padding: 10px; background-color: #000; color: #fff; border: none; border-radius: 4px; font-size: 16px; cursor: pointer; } button:hover { background-color: #444; }
Leave a Comment