Hi! I am very new to PHP and don't know so much about it... but now I am going to make an webage with Login and Register functions...and I need some help with the register Function part...
I dont know how to actually write the script so It checks the information begin written in the register form...for example so that not the username already exists in the database....
This is what I have so far:
register.html:
<!doctype html public "-//W3C//DTD HTML 4.0 //EN">
<html>
<head>
<title>Register</title>
</head>
<body>
<center><h1>Register</h1></center>
<form method="post" action="register.php">
<table align="center" border="1" cellspacing="0" cellpadding="3">
<tr><td>Username:</td><td>
<input type="text" name="username" maxlength="40">
</td></tr>
<tr><td>Password:</td><td>
<input type="password" name="passwd" maxlength="50">
</td></tr>
<tr><td>Confirm Password:</td><td>
<input type="password" name="passwd2" maxlength="50">
</td></tr>
<tr><td>E-Mail:</td><td>
<input type="text" name="email" maxlength="100">
</td></tr>
<tr><td colspan="2" align="right">
<input type="submit" name="submit" value="Sign Up">
</td></tr>
</table>
</form>
</body>
</html>
register.php
<?php
include 'db.php'
?>
db.php
<?php
// Connect to MySQL database
$dbconnect = mysql_pconnect("localhost", "username", "Password") or die("Could not connect to database");
$db = wgd;
mysql_select_db($db, $dbconnect)
?>
Please can someone help me what to write in the register.php file?
Have looked at tutorials and other examples but I dont get it so well...maybe someone here can explain it better =)...