db = mysqli_connect("localhost", "root", "1q2w3e", "zepheus"); } function make_game_acc($name, $password, $admin = 0) { $stmt = $this->db->prepare("SELECT * FROM accounts WHERE Username = ?"); $stmt->bind_param("s", $name); $stmt->execute(); $stmt->store_result(); if ($stmt->num_rows != 0) { return 2; //Name already used } $stmt = $this->db->prepare("INSERT INTO accounts (`Username`, `Password`, `Admin`) VALUES (?, ?, ?)"); $stmt->bind_param("ssi", $name, $password, $admin); $stmt->execute(); return 1; } } $zepheus = new zepheus; if (isset($_POST['submit'])) { //register the player. //make our own checks for data validity. In terms of the code, it will take anything it's given (injections impossible) if ($_POST['password'] == $_POST['password2']) { $create = $zepheus->make_game_acc("$_POST[username]", "$_POST[password]", "$_POST[username]", 1, "$_SERVER[REMOTE_ADDR]"); if ($create == 2) { $error = "
\"$_POST[username]\" is already a registered account name.
Please use another account name.
"; } elseif ($create == 1) { $error = "Everything went fine ;)!
"; } else { $error = "Something went wrong. Please try again!
"; } } else { $error = "The given passwords don't match :(
"; } } else { $error = ""; } ?> Register script Zepheus - fiemeCP
Register for Zepheus.
Username:
Password:
Repeat Password:
©2011 xDario. Part of fiemeCP (rev )
Skin by: xDario (this may be removed and changed at will. The copyright notice above must stay.)