Skip to content

Instantly share code, notes, and snippets.

@maxixo
Created January 23, 2026 11:53
Show Gist options
  • Select an option

  • Save maxixo/465cd94b90c97a72df3dd6c4e9712345 to your computer and use it in GitHub Desktop.

Select an option

Save maxixo/465cd94b90c97a72df3dd6c4e9712345 to your computer and use it in GitHub Desktop.
login registration with php
<?php
$conn = new mysqli("localhost", "root", "", "user_system");
$username = $_POST['username'];
$email = $_POST['email'];
$password = password_hash($_POST['password'], PASSWORD_DEFAULT);
$sql = "INSERT INTO users (username, email, password) VALUES (?, ?, ?)";
$stmt = $conn->prepare($sql);
$stmt->bind_param("sss", $username, $email, $password);
$stmt->execute();
echo "Registration Susscessful!";
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Registration</title>
</head>
<body>
<form action="register.php" method="POST">
<input type="text" name="username" placeholder="username" required>
<input type="email" name="email" placeholder="email" required>
<input type="password" name="password" placeholder="password" required>
<button type="submit">Register</button>
</form>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment