<form method="get" action="register.php">
<input type="text" name="player" placeholder="username">
<input type="submit" value="Register">
</form>
<?php
$host="localhost";
$port=3306;
$user="root";
$pass="root";
$db="minecraft";
$table="whitelist";
$player=$_GET['player'];
$mysqli=new mysqli($host, $user, $pass, $db, $port);
if($mysqli->query("INSERT INTO ".$table." VALUES ('".$player."')")){
printf("Successful!\n");
} else {
printf("Error: %s\n", $mysqli->error);
}
$mysqli->close();
?>
Posts Quoted:
Reply
Clear All Quotes
Comments