Jump to content

White_Lily

Members
  • Posts

    531
  • Joined

  • Last visited

  • Days Won

    1

Posts posted by White_Lily

  1. create a column in your database called "type" make this a tinyint of 1.

     

    now - normal users will be 0

    and admins will 1

     

    E.g:

     

    $query = mysql_query("SELECT type FROM users WHERE username = '$user'");
    $gettype = mysql_fetch_assoc($query);
    if($gettype["type"] == 0{
    //code for normal users
    }elseif($gettype["type"] == 1){
    //code for admins
    }

  2. 1) to keep consistency use an input type instead of a button for "continue".

    2) escape some of those $_POST values.

    3) don't post connection details on here

    4) use error_reporting in a php.ini file.

     

    e.g:

    display_errors = on
    error_reporting = -1

  3. $regPassword = sha1($regPassword);
    $id = uniqid();
    
    $register = insert("members", "name, email, username, password, user_level, id, ban", "'$regName', '$email', '$regUsername', '$regPassword', 1, '$id', 0");
    
    if($register){
    
    $newsTitle = "New member registered!";
    
    $cont = $regUsername." has just joined Fusion Forums!<br>";
    $cont.= "Check out his/her profile:<br><br>";
    $cont.= "View Profile";
    
    $newsCont = $cont;
    
    $newMem = insert("news", "news_title, news_content, username", "'$newsTitle', '$newsCont', '$regUsername'");
    
    if($newMem){ 
    $to = $email;
    $subject = "Fusion Forums - Account Confirmation";
    $message = "Hello! You have recently registered to Fusion Forum's.<br><br>";
    $message.= "This is a confirmation email, below you will find your account details along with a Unique ID.<br><br>";
    $message.= "In order to activate your account you must first enter the ID into the text field that follows the link at the end of this email. Your details are as follows:<br><br>";
    $message.= "<table>";
    $message.= "<tr>";
    $message.= "<td><strong>Name:</strong></td>";
    $message.= "<td></td>";
    $message.= "<td>".$regName."</td>";
    $message.= "<tr>";
    $message.= "<tr>";
    $message.= "<td><strong>Email:</strong></td>";
    $message.= "<td></td>";
    $message.= "<td>".$email."</td>";
    $message.= "<tr>";
    $message.= "<tr>";
    $message.= "<td><strong>Username:</strong></td>";
    $message.= "<td></td>";
    $message.= "<td>".$regUsername."</td>";
    $message.= "<tr>";
    $message.= "<tr>";
    $message.= "<td><strong>Unique ID:</strong></td>";
    $message.= "<td></td>";
    $message.= "<td>".$id."</td>";
    $message.= "<tr>";
    $message.= "</table><br><br>";
    $message.= "Please follow this link in order to activate your account (opens in your default browser):<br>";
    $message.= "<a href='http://www.janedealsart.co.uk/activate.php?id=".$id."'>Activate Account</a>";
    $from = "noreply@janedealsart.co.uk";
    $headers = 'MIME-Version: 1.0' . "\r\n";
    $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
    $headers.= "From: ".$from;
    mail($to, $subject, $message, $headers);
    $done = "You have successfully registered to Fusion Fourm's.<br>";
    $done.= "We have sent you an email with a confirmation code on it,";
    $done.= " when you go to confirm your account you will need this code in order to be able to access the forum's.";
    
    $msg2 .= $done; 
    
    }else{
    $msg3 .= "Sorry, we could not register your account details, if this persists contact the webmaster. ";
    }
    }else{
    $msg3 .= "Sorry, we could not register your account details, if this persists contact the webmaster. ";
    }

     

    That should work, it writes the users details to the database, enters some content into a news feed, then sends the user who registered an email with their details.

  4. I am trying to get my registration form secure from a user point of view. What I want is something like a text pattern that won't let the user register unless they have at least 1 number and one capital letter within their password and their password must be at least 6 characters long and maximum of 25 characters long.

     

     

    I was wondering how I would go about this, and if their is a text pattern involved, how do I write them?

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.