One of my friends made a script for a site. I am not an master at script. He helped me with this one but i need to change it for a game site. I am useing justhost. It's a register script and i wanna make some changes:
change it to:
username
email
validate email
password
validate password.
can anyone help me change it so it can work with database and remove anything thats nit needed. ty
<?php
PHP Code:
// Check if he wants to register:
if (!empty($_POST[username]))
{
// Check if passwords match.
if ($_POST[password] != $_POST[password2])
exit("Error - Passwords don't match. Please go back and try again.");
// Assign some variables.
$date = mktime("d - m - Y");
$ip = $_SERVER[REMOTE_ADDR];
require_once("connect.php");
// Register him.
$query = mysql_query("INSERT INTO members
(username, firstname, lastname, password, date, ip)
VALUES ('$_POST[username]','$_POST[firstname]','$_POST[lastname]','$_POST[password]','$date','$ip')")
or die ("Error - Couldn't register user.");
<?php // Check if he wants to register: if (!empty($_POST[username])) { // Check if passwords match. if ($_POST['password'] != $_POST['password2']) exit("Error - Passwords don't match. Please go back and try again.");
if ($_POST['email'] != $_POST['email2']) exit("Error - Emails don't match. Please go back and try again.");
// Assign some variables. $date = mktime("d - m - Y"); $ip = $_SERVER['REMOTE_ADDR'];
require_once("connect.php");
// Register him. $query = mysql_query("INSERT INTO members (username, email, password, date, ip) VALUES ('".$_POST['username']."','".$_POST['email']."','".$_POST['password']."','$date','$ip')") or die ("Error - Couldn't register user.");