View Single Post
Old 10-20-2008, 03:21 AM   #1 (permalink)
codefreek
Super Moderator
Inquisitive 
 
codefreek's Avatar
 
Join Date: Sep 2007
Location: Near you.
Posts: 791
Thanks: 241
codefreek is on a distinguished road
Help Need some help, and i have got some questions to ask as well.

So i will start of with saying thank you to everyone who has helped me before and who will help out, and i will try to help out as much as i can. So for the question part. i was thinking what is the best way to secure an account i mean password and so on.

like password salt?
and stuff like that, i am
still a bit fuzzy on the part where you secure the password.
So all the help i can get is really appreciated.

And then i would need some help on why this is not working

i get this
print "You're account was made!";
but noting appears in the db.


PHP Code:
<?php
include 'config.php';
if(isset(
$_POST['submit']))
{

$username $_POST['username'];
$password $_POST['password'];
$email       $_POST['email'];
$referral $_POST['referral'];

      if(
strlen($username)<1
    {
        echo 
"You forgot to put in a username!";
    }
    
    if(
strlen($password)<1
    {
        echo 
"You Forgot to put in a password!";
    }
    
     if(
strlen($email)<1
    {
        echo 
"You did not put in you're email!";
    }
    
    else
    {
        if(
preg_match('/^([a-zA-Z0-9])+@([a-zA-Z0-9_-])+(\.[a-zA-Z0-9_-]+)+/'$email))
        {
            
$query=( "INSERT INTO user (id, username,password,email,rank,referral,joined,ip) VALUES ('$id','$username',password('$password'),'$email','Normal','$referral',NOW(),'$ip')");
            
mysql_query($query) or die(mysql_error());
        }
        
    else 
    {
            
         print 
"You're account was made!";
            
    }
  }
}
else 
{
         echo 
"<form action='register.php' method='post'>",
         
"Please do mix, you're password with letters and numeric characters.</br>",
         
"Username:",
         
"<input type='text' name='username' size='15'/></br>",
         
"Password:",
         
"<input type='password' name='password' size='15'/></br>",
         
"Email:",
         
"<input type='text' name='email' size='15'/><br/>",
         
"Referral:",
         
"<input type='text' name='referral' size='15'/></br>",
         
"<input type='submit' name='submit' value='submit'/></form>";    
}


?>

Thank you in advance!
Code;Freek!
codefreek is offline  
Reply With Quote