PHP Form

trev

Member
Prime Account
Messages
670
Reaction score
0
Points
16
Hay can any one help me out here, im trying to get a registration form working for a site im building but im stuck. As in i havent got a clue, iv got a working login form but cant seem to find a registration form. Im trying to add a username, password, IP, Email, Address and Age into a SQL data base. Can any one help me out with a website telling me how or some pointers please.

Thanks Trev.
 

Deshi

New Member
Messages
32
Reaction score
0
Points
0
Hey there,
Hope this helps...just edit the variables...pretty easy. Post back if you don't understand.

PHP:
<?
$username="sql username";
$password="sql password";
$database="database name";
 
 
$name=$_POST['name'];
$website=$_POST['website'];
$location=$_POST['location'];
$comment=$_POST['comment'];
$time=date("h:i A");
$date=date("j/m/Y");
$ip="$REMOTE_ADDR";
$email=$_POST['email'];
$showemail=$_POST['showemail'];
 
mysql_connect(localhost,$username,$password);
@mysql_select_db($database) or die( "Unable to select database");
 
$query = "INSERT INTO guestbook (name, website, location, comment, time, date, ip, email, showemail) VALUES ('$name','$website','$location','$comment','$time','$date','$ip','$email','$showemail')";
mysql_query($query);
mysql_close();
?>

- Ross
 

trev

Member
Prime Account
Messages
670
Reaction score
0
Points
16
Thanks very much Deshi
Does any one know how i can make it so the username email address and location cant be the same when people register?
 
Last edited:
Top