Quote:
Originally Posted by Ryu[PM]
How to configure Website to create account on server, rating etc?
|
What are you using XAMPP APACHE ???
all you need is and index page that links to a registration php that all links to ur DB .
Here is a simple registration.php just edit the DB name user and pass to yours . Connect it to your index.php and ur good to go.
Save as registration.php put it in ur htdocs/www what ever folder ur using
----------------------------------------------------------------------------------
<?php
$host = "localhost";
$user = "YOURUSER";
$pass = "YourPASS";
$dbname = "YourDB";
$conn = new mysqli($host, $user, $pass, $dbname);
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
$username = strtolower(trim($_POST['username']));
$password = trim($_POST['password']);
if (empty($username) || empty($password)) {
die("Please fill in all fields.");
}
$usernameEsc = $conn->real_escape_string($username);
// EO Salt (same as your change password script)
$salt1 = "\xa3\xac\xa1\xa3";
$salt2 = "fdjf,jkgfkl";
$hashedPassword = md5($password . $salt1 . $salt2);
// Check if username exists
$check = $conn->query("SELECT * FROM account WHERE name = '$usernameEsc'");
if ($check && $check->num_rows > 0) {
die("<h2>Error:</h2><p>Username already exists. Please choose a different one.</p>");
}
// Insert with all required fields
$sql = "INSERT INTO account
(name, password, type, point, pointtime, online, reg_date, licence, reg_flag, netbar_ip, ip_mask, add_type, VIP, offline)
VALUES
('$usernameEsc', '$hashedPassword', 0, 0, 20020318, 0000, NOW(), 0, 3, '127.0.0.1', '255.255.255.255', 0, 4, 0)";
if ($conn->query($sql)) {
echo "<h2>Registration successful!</h2><p>You can now log in with your account.</p>";
} else {
echo "<h2>Error:</h2><p>" . $conn->error . "</p>";
}
$conn->close();
?>
------------------------------------------------------------------------------------------------------------
If you dont have an index heres a simple one for you to start with.
Save as index.php to ur web folder like you did with registration.php
-----------------------------------------------------------------------------------------------------------
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>YOURSERVERNAME Online - Register</title>
<style>
body {
font-family: Arial, sans-serif;
background: #111;
color: #fff;
text-align: center;
padding: 50px;
}
form {
background: #222;
padding: 20px;
border-radius: 10px;
max-width: 300px;
margin: 0 auto;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}
input[type="text"], input[type="password"] {
width: 90%;
padding: 10px;
margin: 10px 0;
border: none;
border-radius: 5px;
}
input[type="submit"] {
padding: 10px 20px;
border: none;
border-radius: 5px;
background: #f00;
color: #fff;
cursor: pointer;
}
input[type="submit"]:hover {
background: #c00;
}
h1 {
color: #f00;
}
</style>
</head>
<body>
<h1>Register for YOURSERVERNAME Online</h1>
<form action="registration.php" method="post">
<input type="text" name="username" placeholder="Username" required>
<input type="password" name="password" placeholder="Password" required>
<input type="submit" value="Register">
</form>
</body>
</html>
-----------------------------------------------------------------------------------------------------
Start ur webserver up and you should be good to go
Discord: hulberto1995