REGISTRATION:
<div style="width:100px; text-align:right; float:left">
<div style="height:21px; line-height:20px">username</div>
<div style="height:21px; line-height:20px">password</div>
<div style="height:21px; line-height:20px">email</div>
</div>
<div style="width:200px; padding: 0 0 0 10px; float:left">
<form action="insert2.php" method="post">
<input type="text" name="username" /><br />
<input type="password" name="password" /><br />
<input type="text" name="email" /><br /><br />
<input type="submit" value="Submit" />
</form>
</div>
----------------------------------
INSERT USER INFO:
<?php
$con = mysql_connect("localhost","My username","1234");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("My Db", $con);
$sql="INSERT INTO users (username, password, email)
VALUES
(
'$_POST[username]','$_POST[password]','$_POST[email]')";
if (!mysql_query($sql,$con))
{
die('Error: ' . mysql_error());
}
$fname = $_POST['username'];
header("location: welcome2.php?fname=".urlencode($fname));
mysql_close($con)
?>
|