Quote:
Originally Posted by BeatEmUp
hey, i think i went wrong somewhere: i got the php stuff in a file, and i got the html stuff at my site, but i still dont really have the php linked to my site. how can i do this?
|
what are u lost on?
PHP Code:
<form method="post" action="">
Username: <input type="text" name="username" value="" /><br/>
Password: <input type="password" name="pass" value="" /><br/>
Repeat Password: <input type="password" name="pass2" value=""/><br/>
<input type="submit" name="submit" value="Submit" />
</form>
<?php
$conn = mysql_connect("localhost", "root", "mysqlpass");
$db = mysql_select_db("coproj");
if(isset($_POST['submit']))
{
if(isset($_POST['pass']) && $_POST['pass'] != "")
{
if($_POST['pass'] == $_POST['pass2'])
{
if(strlen($_POST['pass']) > 3 && strlen($_POST['pass']) < 32)
{
$sql = "INSERT INTO `tablename` (Table1, Table2) VALUES ('".$_POST['username']."', '".$_POST['pass']."')";
$sql = mysql_query($sql);
echo "Registered Successfully";
} else {
die("Your password must be between 3 and 32 characters.");
}
} else {
die("Your passwords do not match.");
}
} else {
die("Please enter in a password.");
}
}
?>
Is everything you need to have then you just throw it into a .txt rename it to say reg.php then put it where you have ur apache installed.. being through xampp or Appserv.