It's a simple register script, should work just fine. There's 3 fields, when you submit it it work as it should. I go into phpMyAdmin and the name and email tables are empty, but in the password box theres an md5 code. I'm hoping someone could help me out here. I'm with 000webhost, just need some free hosting for random **** like this. Not sure if they have something to do with this but just incase someone knowsI thought I'd put it.
PHP Code:<form action="?action=register" method="POST">
username: <input type="text" name="user" /><br />
email: <input type="text" name="email" /><br />
password: <input type="text" name="password" /><br />
<input type="submit" value="lets go" />
</form>
<?php
include "config.php";
$user = $_POST['user'];
$email = $_POST['email'];
$cleanPassword = $_POST['password'];
$password = md5($cleanPassword);
if($_GET['action'] == "register"){
if($user = ""){
echo "enter a username dumbass..";
}
if($cleanPassword = ""){
echo "enter a password...";
}
if($email = ""){
echo "enter an email..";
}
$ifExist = mysql_num_rows(mysql_query("SELECT * FROM users WHERE name = '$user'"));
if($ifExist >= 1){
echo "name has been taken.";
}
else {
$sql = mysql_query("INSERT INTO users (name, email, password) VALUES('$user', '$email', '$password')");
if($sql){
echo "youve been registered. login ********.";
} else {
echo "try again. something ****** up.";
}
}
}
?>


Reply With Quote





