Discover Habbo's history
Treat yourself with a Secret Santa gift.... of a random Wiki page for you to start exploring Habbo's history!
Happy holidays!
Celebrate with us at Habbox on the hotel, on our Forum and right here!
Join Habbox!
One of us! One of us! Click here to see the roles you could take as part of the Habbox community!


Page 1 of 2 12 LastLast
Results 1 to 10 of 11
  1. #1
    Join Date
    Jul 2005
    Location
    Bristol
    Posts
    2,054
    Tokens
    -10

    Latest Awards:

    Default ||Advanced Login System||

    I take no credit for this script, i got it off techtuts.com, but i put it together into 1 easy tutorial.. This will allow you to make a pm system and admin system within the log in, it will also have a profile hingy aswell ''/ This is really easy ;P you can see an example of it by clicking the link below

    Please bere in mind that even though i didnt write this it took me a long time. I put 4 basic tutorials together into 1 huge tutorial..

    www.crisphosting.net/~habbopro/Login.php
    Username: Test
    Pass: test

    If on the first time you log in it only displays the word members, press back and relogin..

    This tutorial is in 4 parts:
    Part 1: User System
    Part 2: Who is online?
    Part 3: Private Messaging System
    Part 4: Admin system


    Right here we go:

    Part 1

    Create a database, this can be anything you like. Then make a Username and pass for the database and add it to the database.. This is pretty easy..



    Then go into phpmyadmin, and add this mySQL Query:

    PHP Code:
    CREATE TABLE `users` (
    `
    idint(11NOT NULL auto_increment,
    `
    usernamevarchar(30NOT NULL default '',
    `
    passwordvarchar(255NOT NULL default '',
    `
    emailvarchar(40NOT NULL default '',
    `
    msnvarchar(250NOT NULL default 'Not Specified',
    `
    aimvarchar(250NOT NULL default 'Not Specified',
    `
    locationvarchar(36NOT NULL default 'Not Specified',
    PRIMARY KEY (`id`)
    TYPE=MyISAM
    Now we need a file to connect to the database with.

    Make a file called config.php and add this php code. Make sure you mod it to YOUR database details:

    PHP Code:
    <? 
       ob_start
    (); // allows you to use cookies 
       
    $conn mysql_connect("localhost","DATABASE USERNAME","DATABASE PASSWORD"); 
       
    mysql_select_db(DATABASE NAME) or die(mysql_error()); 
       
    //fill in the above lines where there are capital letters. 
       
    $logged MYSQL_QUERY("SELECT * from users WHERE id='$_COOKIE[id]' AND password = '$_COOKIE[pass]'"); 
       
    $logged mysql_fetch_array($logged); 
       
    //the above lines get the user's information from the database. 
    ?>
    Now, on EVERY page that you make in the rest of this tutorial, add this code to the top of every page:

    PHP Code:
    <? 
    ob_start
    (); 
    include(
    "config.php"); 
    ?>
    This starts the database(I think you may need to only add it to the pages that you want to login on.. But just to be sure..

    Coding the Pages

    Create a file named Register.php, and add this code..

    PHP Code:
    <?php 
    ob_start
    (); 
    // allows you to use cookies 
    include("config.php"); 
    //gets the config page 
    if ($_POST[register]) { 
    // the above line checks to see if the html form has been submitted 
    $username $_POST[username]; 
    $password $_POST[pass]; 
    $cpassword $_POST[cpass]; 
    $email $_POST[emai1]; 
    //the above lines set variables with the user submitted information 
    if($username==NULL|$password==NULL|$cpassword==NULL|$email==NULL) { 
    //checks to make sure no fields were left blank 
    echo "A field was left blank."
    }else{ 
    //none were left blank!  We continue... 
    if($password != $cpassword) { 
    // the passwords are not the same!   
    echo "Passwords do not match"
    }else{ 
    // the passwords are the same!  we continue... 
    $password md5($password); 
    // encrypts the password 
    $checkname mysql_query("SELECT username FROM users WHERE username='$username'"); 
    $checknamemysql_num_rows($checkname); 
    $checkemail mysql_query("SELECT email FROM users WHERE email='$email'"); 
    $checkemail mysql_num_rows($checkemail); 
    if (
    $checkemail>0|$checkname>0) { 
    // oops...someone has already registered with that username or email! 
    echo "The username or email is already in use"
    }else{ 
    // noone is using that email or username!  We continue... 
    $username htmlspecialchars($username); 
    $password htmlspecialchars($password); 
    $email htmlspecialchars($email); 
    // the above lines make it so that there is no html in the user submitted information. 
    //Everything seems good, lets insert. 
    $query mysql_query("INSERT INTO users (username, password, email) VALUES('$username','$password','$email')"); 
    // inserts the information into the database. 
    echo "You have successfully registered!"




    else 

    // the form has not been submitted...so now we display it. 
    echo (
    <center> 
    <form method=\"POST\"> 
    Username: <input type=\"text\" size=\"15\" maxlength=\"25\" name=\"username\"><br /> 
    Password: <input type=\"password\" size=\"15\" maxlength=\"25\" name=\"pass\"><br /> 
    Confirm Password: <input type=\"password\" size=\"15\" maxlength=\"25\" name=\"cpass\"><br /> 
    Email: <input type=\"text\" size=\"15\" maxlength=\"25\" name=\"emai1\"><br /> 
    <input name=\"register\" type=\"submit\" value=\"Register\"> 
    </form> 
    </center> 
    "
    ); 

    ?>
    Now that people can register, we need to make it so that they can login...

    Create a file named Login.php and add this code to it.. Remember to mod the bit at the bottom to YOUR site.

    PHP Code:
    <? 
    oB_start
    (); 
    // allows you to use cookies. 
    include("config.php"); 
    if (!
    $logged[username]) 

    if (!
    $_POST[login]) 

    echo(

    <center><form method=\"POST\"> 
    <table> 
    <tr> 
    <td align=\"right\"> 
    Username: <input type=\"text\" size=\"15\" maxlength=\"25\" name=\"username\"> 
    </td> 
    </tr> 
    <tr> 
    <td align=\"right\"> 
    Password: <input type=\"password\" size=\"15\" maxlength=\"25\" name=\"password\"> 
    </td></tr><tr> 
    <td align=\"center\"> 
    <input type=\"submit\" name=\"login\" value=\"Login\"> 
    </td></tr><tr> 
    <td align=\"center\"> 
    <a href=\"register.php\">Register Here</a> 
    </td></tr></table></form></center>"
    ); 
     } 
    if (
    $_POST[login]) { 
    // the form has been submitted.  We continue... 
    $username=$_POST['username']; 
    $password md5($_POST[password]); 
    // the above lines set variables with the submitted information.   
    $info mysql_query("SELECT * FROM users WHERE username = '$username'") or die(mysql_error()); 
    $data mysql_fetch_array($info); 
    if(
    $data[password] != $password) { 
    // the password was not the user's password! 
    echo "Incorrect username or password!"
    }else{ 
    // the password was right! 
    $query mysql_query("SELECT * FROM users WHERE username = '$username'") or die(mysql_error()); 
    $user mysql_fetch_array($query); 
    // gets the user's information 
    setcookie("id"$user[id],time()+(60*60*24*5), "/"""); 
    setcookie("pass"$user[password],time()+(60*60*24*5), "/"""); 
    // the above lines set 2 cookies. 1 with the user's id and another with his/her password.   
    echo ("<meta http-equiv=\"Refresh\" content=\"0; URL=http://yoursite.com\"/>Thank You! You will be redirected"); 
    // modify the above line...add in your site url instead of yoursite.com 



    else 

    // we now display the user controls. 
    echo ("<center>Welcome <b>$logged[username]</b><br /></center> 
    - <a href=\"editprofile.php\">Edit Profile</a><br /> 
    - <a href=\"members.php\">Member List</a><br /> 
    - <a href=\"logout.php\">Logout</a>"
    ); 

    ?>
    This makes it so that when people login, they can edit their profile, view all the members and logout. Please be aware that these wont work yet, as we havent made the files ''/

    THIS is where we make the edit profile page, members can write a little profile on themselves, if you want to add more options to the profile page, simple message me and i'll help you out..

    Create a file named editprofile.php and add this code:

    PHP Code:
    <? 
    ob_start
    (); 
    include(
    "config.php"); 
    if (
    $logged[username]) 

    // the user is logged in!  We continue... 
    if (!$_POST[update]) 

    // the form hasn't been submitted.  We continue... 
    $profile mysql_query("SELECT * from users where username = '$logged[username]'"); 
    $profile mysql_fetch_array($profile); 
    // the above lines get the information so that it can be displayed in the html form. 
    echo(
    <center><form method=\"POST\"> 
    <table width=\"100%\"> 
    <tr> 
    <td align=\"right\" width=\"25%\"> 
    Location  
    </td> 
    <td align=\"left\"> 
     <input type=\"text\" size=\"25\" maxlength=\"25\" name=\"locate\" value=\"
    $profile[location]\"></td> 
    </tr> 
    <tr> 
    <td align=\"right\" width=\"25%\"> 
    MSN Messenger  
    </td> 
    <td align=\"left\"> 
     <input size=\"25\" name=\"msn\" value=\"
    $profile[msn]\"></td> 
    </tr> 
    <tr> 
    <td align=\"right\" width=\"25%\"> 
    AOL Messenger</td> 
    <td align=\"left\"> 
     <input size=\"25\" name=\"aim\"  value=\"
    $profile[aim]\"></td> 
    </tr> 
    <tr> 
    <td align=\"right\" width=\"25%\"> 
    Email Address</td> 
    <td align=\"left\"> 
     <input size=\"25\"  name=\"email\" value=\"
    $profile[email]\"></td> 
    </tr> 
    <tr> 
    <td align=\"center\"> 
     </td> 
    <td align=\"left\"> 
     <input type=\"submit\" name=\"update\" value=\"Update\"></td> 
    </tr> 
    </table> 
    </form> 
    </center>"
    ); 

    else 

    $email htmlspecialchars($_POST[email]); 
    $aim htmlspecialchars($_POST[aim]); 
    $msn htmlspecialchars($_POST[msn]); 
    $locate htmlspecialchars($_POST[locate]); 
    // the above lines get rid of all html. 
    echo ("Your profile has been updated!"); 
    $update mysql_query("Update users set email = '$email',  
    msn = '
    $msn', aim = '$aim', location = '$locate' where username = '$logged[username]'"); 
    // updates the information in the database. 


    else 

    // They aren't logged in! 
    echo ("<a href=\"login.php\">You must login</a>"); 

    ?>
    Viewing members and their profiles

    Create a file named members.php and add this code:

    PHP Code:
    <? 
    ob_start
    (); 
    include(
    "config.php"); 
    if (!
    $_GET[user]) 

    $getuser mysql_query("SELECT * from users order by id asc"); 
    while (
    $user mysql_fetch_array($getuser)) 

    // gets all the users information.  
    echo ("<a href=\"members.php?user=$user[username]\">$user[username]</a><br />\n"); 
    // links to a page to view the user's profile. 


    ELSE 

    $getuser mysql_query("SELECT * from users where username = '$_GET[user]'"); 
    $usernum mysql_num_rows($getuser); 
    if (
    $usernum == 0

    echo (
    "User Not Found"); 

    else 

    $profile mysql_fetch_array($getuser); 
    echo (
    "<center><b>$profile[username]'s Profile:</b><br /></center> 
    MSN Messenger: 
    $profile[msn]<br /> 
    AIM Messebger: 
    $profile[aim]<br /> 
    Location: 
    $profile[location]<br /> 
    Email: 
    $profile[email]"); 
    // in the above code, we display the user's information. 


    ?>
    This will show every member that has registered, and their profile.

    Now we need to make where members Logout, create a file named Logout.php and add this code:

    PHP Code:
    <? 
    ob_start
    (); 
    setcookie("id"2132421,time()+(60*60*24*5), "/""");  
    setcookie("pass"loggedout,time()+(60*60*24*5), "/"""); 
    echo (
    "You are now logged out!"); 
    ?>
    On pages that you want to be members only ( Only people who are logged in will be able to view the page ) Add this code to the top of the page:

    PHP Code:
    <? 
       ob_start
    (); 
       include(
    "config.php"); 
       if (
    $logged[username]) 
       { 
          echo(
    "You can put html and stuff in here.</font>"); 
       } 
       else 
       { 
          echo(
    "You are not logged in"); 
       } 
    ?>
    If you want to put the login system into a content box on a main website, simple add this bit of simple code:

    PHP Code:
    <? 
       
    include("login.php"); 
    ?>
    Part 2: Showing who is online..

    We will have to add a new field to our "users" database table. Go into phpmyadmin and execute this query. (To do this navigate to the tab that says "SQL" in your database.)

    Add this code:

    PHP Code:
    alter table `usersadd online varchar(12
    Now create a file called online.php and add this code:

    PHP Code:
    <? 
    include("config.php");  
    $offline 300//How long is considered online? 
    $current time(); //gets the time on the server (unformatted) 
    $offline = ($current-$offline); // 
    if ($logged[username]) 

    $update mysql_query("UPDATE users set online = '$current' where username = '$logged[username]'"); 
    //the above line sets the time the user was online to the current time 

    ?>
    This will show who is online etc.. 300 means 5 mins

    You will have to add the following code to every page you want to log online users on:

    PHP Code:
    <? 
    include("online.php"); 
    ?>
    In the area that you want to show who is online, add this code (the other code merely adds the previous online.php code to the page:

    PHP Code:
    <? 
    include("config.php");  
    $offline 300;  // 5 minutes 
    $current time(); //gets the current time 
    $offline = ($current-$offline); //the cutoff time for being considered online 
    $getusers mysql_query("SELECT * from users where online >= '$offline'"); 
    //gets the users that are online 
    while ($users mysql_fetch_array($getusers)) 

    echo (
    "$users[username], "); 
    //displays the online users 

    ?>
    Part 3: Private Messaging System

    Ok, we need to go back into phpmyadim and run this query:

    PHP Code:
    CREATE TABLE `pmessages` (
    `
    titlevarchar(255NOT NULL default 'Untitled Message',
    `
    messagetext NOT NULL,
    `
    touservarchar(255NOT NULL default '',
    `
    fromvarchar(255NOT NULL default '',
    `
    unreadvarchar(255NOT NULL default 'unread',
    `
    datedate NOT NULL default '0000-00-00',
    `
    idint(15NOT NULL auto_increment,
    `
    replyvarchar(15NOT NULL default 'no',
    PRIMARY KEY (`id`)
    TYPE=MyISAM
    Now, create a file called messages.php and add this code:

    PHP Code:
    <? 
    ob_start
    (); 
    //the above line needs to be above ALL HTML and PHP (except for <?). 
    include("config.php"); 
    //gets the config page, which connects to the database and gets the user's information 
    if ($logged[username]) 

    //checks to see if they are logged in 
    switch($_GET[page]) 

    //this allows us to use one page for the entire thing 
    default: 
    echo (
    "- <a href=\"messages.php?page=inbox\">Inbox</a><br /> 
    - <a href=\"messages.php?page=write\">New Message</a>"
    ); 
    break; 
    case 
    'write'
    if (!
    $_POST[send]) 

    //the form hasnt been submitted yet.... 
    echo ("<form method=\"POST\" style=\"margin: 0px;\"> 
        <dl style=\"margin: 0px;\"> 
                <dt>recipient</dt> 
                <dd> 
                <select name=\"to\"> 
    "
    ); 
    $getusers mysql_query("SELECT * FROM users ORDER BY 'username' ASC"); 
                while (
    $users MySQL_Fetch_Array($getusers)) { 
        echo (
    "<option value=\"$users[username]\">$users[username]</option>"); 

    //the above line gets all the members names and puts them in a drop down box 
    echo (
    </select> 
    </dd> 
    <dt>Message Subject</dt> 
    <dd><input type=\"text\" name=\"subject\" size=\"20\"></dd> 
    <dt>Message</dt> 
    <dd><textarea rows=\"7\" name=\"message\" cols=\"35\"></textarea> 
    </dd><dt> </dt> 
    <dd><input type=\"submit\" value=\"Submit\" name=\"send\"></dd> 
    </dl> 
    </form> 
    "
    ); 

    if (
    $_POST[to]) 

    //the form has been submitted.  Now we have to make it secure and insert it into the database 
    $subject htmlspecialchars(addslashes("$_POST[subject]")); 
    $message htmlspecialchars(addslashes("$_POST[message]")); 
    $to htmlspecialchars(addslashes("$_POST[to]")); 
    //the above lines remove html and add \ before all " 
    $send mysql_query("INSERT INTO `pmessages` ( `title` , `message` ,  
    `touser` , `from` , `unread` ,  
    `date` ) VALUES ('
    $subject', '$message', '$to',  
    '
    $logged[username]', 'unread', NOW())"); 
    echo (
    "Your message has been sent."); 

    break; 
    case 
    'delete'
    if (!
    $_GET[msgid]) 

    echo (
    "Sorry, but this is an invalid message!"); 

    else 

    $getmsg mysql_query("SELECT * from pmessages where id = '$_GET[msgid]'"); 
    $msg mysql_fetch_array($getmsg); 
    //hmm..someones trying to delete someone elses messages!  This keeps them from doing it 
    if ($msg[touser] != $logged[username]) 

    echo (
    "This message was not sent to you!"); 


    else 

    $delete  mysql_query("delete from pmessages where id = '$_GET[msgid]'"); 
    echo (
    "Message Deleted"); 


    break; 
    case 
    'inbox'
    $get mysql_query("SELECT * from pmessages where touser = '$logged[username]' order by id desc"); 
    echo(

    <table bgcolor=\"#dddddd\" border=\"0\" width=\"100%\" cellspacing=\"0\"> 
    <tr> 
    <td align=\"center\">Subject</td> 
    <td align=\"center\" width=\"125\">From</td> 
    <td align=\"center\" width=\"97\">Date</td> 
    <td width=\"25\">Delete</td> 
    </tr> 
    </table> 
    "
    ); 
    $nummessages mysql_num_rows($get); 
    if (
    $nummessages == 0

    echo (
    "You have 0 messages!"); 

    else 

    echo(
    "<table border=\"0\" width=\"100%\" cellspacing=\"1\">"); 
    while (
    $messages mysql_fetch_array($get)) 

    //the above lines gets all the messages sent to you, and displays them with the newest ones on top 
    echo (
    <tr> 
    <td><a href=\"messages.php?page=view&msgid=
    $messages[id]\">"); 
    if (
    $messages[reply] == yes

    echo (
    "Reply to: "); 

    echo (
    "$messages[title]</a></td> 
    <td width=\"125\">
    $messages[from]</td> 
    <td width=\"97\">
    $messages[date]</td> 
    <td width=\"25\"><a href=\"messages.php?page=delete&msgid=
    $messages[id]\">Delete</a></td> 
    </tr>"
    ); 

    echo (
    "</table>"); 

    break; 
    case 
    'view'
    //the url now should look like ?page=view&msgid=# 
    if (!$_GET[msgid]) 

    //there isnt a &msgid=# in the url 
    echo ("Invalid message!"); 

    else 

    //the url is fine..so we continue... 
    $getmsgmysql_query("SELECT * from pmessages where id = '$_GET[msgid]'"); 
    $msg mysql_fetch_array($getmsg); 
    //the above lines get the message, and put the details into an array. 
    if ($msg[touser] == $logged[username]) 

    //makes sure that this message was sent to the logged in member 
    if (!$_POST[message]) 

    //the form has not been submitted, so we display the message and the form 
    $markread mysql_query("Update pmessages set unread = 'read' where id = '$_GET[msgid]'"); 
    //this line marks the message as read. 
    $msg[message] = nl2br(stripslashes("$msg[message]")); 
    //removes slashes and converts new lines into line breaks. 
    echo (
    <form method=\"POST\" style=\"margin: 0px;\"> 
    <dl style=\"margin: 0px;\"> 
    <dt><b>
    $msg[title] -- From $msg[from]</b></dt> 
    <dd>
    $msg[message]</dd> 
    <dt><b>Reply</b></dt> 
    <dd><textarea rows=\"6\" name=\"message\" cols=\"45\"></textarea></dd> 
    <dt> </dt> 
    <dd><input type=\"submit\" value=\"Submit\" name=\"send\"></dd> 
    </dl></form>"
    ); 

    if (
    $_POST[message]) 

    //the form HAS been submitted, now we insert it into the database 
    $message htmlspecialchars(addslashes("$_POST[message]")); 
    $do mysql_query("INSERT INTO `pmessages` ( `title` , `message` , `touser` , `from` , `unread` ,  
    `date`, `reply`) VALUES 
    ('
    $msg[title]', '$message', '$msg[from]', '$logged[username]', 
     'unread', NOW(), 'yes')"
    ); 
    echo (
    "Your message has been sent"); 


    else 

    //hmm..this message was NOT sent to the logged in user...so we won't display it. 
    echo("<b>Error</b><br />"); 
    echo (
    "This message was not sent to you!"); 
    }} 
    break; 

    echo(
    "<br /><br /><div align=\"center\"><b><a href=\"?page=inbox\">Inbox</a> · <a href=\"?page=write\">New Message</a></b>"); 

    ?>
    This is what will be the private messaging system which will allow you to send a private message to any member on the member list.

    Now we need to modify login.php so that we can add the link to the private messaging system. Find this code:

    PHP Code:
    echo ("<center>Welcome <b>$logged[username]</b><br /></center> 
    - <a href=\"editprofile.php\">Edit Profile</a><br /> 
    - <a href=\"members.php\">Member List</a><br /> 
    - <a href=\"logout.php\">Logout</a>"
    ); 
    And change it to:

    PHP Code:
    $new mysql_query("select * from pmessages where unread = 'unread' and touser = '$logged[username]'"); 
    $new mysql_num_rows($new); 
    echo (
    "<center>Welcome <b>$logged[username]</b><br /></center> 
    - <a href=\"editprofile.php\">Edit Profile</a><br /> 
    - <a href=\"members.php\">Member List</a><br /> 
    - <a href=\"messages.php\">Private Message Center (
    $new new)</a><br /> 
    - <a href=\"logout.php\">Logout</a>"
    ); 
    This will add the link..

    You now have a Private Messaging system..

    Part 4: Admin system

    This is rather complicated..

    Information
    This system has 2 user levels, but it is easy to add new ones. The levels are:
    1 -- This is for members.
    5 -- This is for administrators.

    You can use levels 2-4 for moderators, tutorial staff--whatever you want.

    We need to add a new field to the users table. Go to phpmyadmin and run this query by pasting it into the sql tab.

    PHP Code:
    ALTER TABLE `usersADD level int) default '1' 
    Change your 'level' to 5 using phpmyadmin, to do this, All u have to do is go into php my admin go to the users table and press browse then click the pencil looking thing then look for

    Level it will say 1, just change it to 5.

    Now we need to add the code which allow the user admin to edit other peoples profiles..

    Create a file named admin.php and add this code:

    PHP Code:
    <? 
    ob_start
    (); 
    include(
    "config.php"); 
    if(
    $logged[username] && $logged[level] ==5

    //checks to see if the user is logged in, and if their user level 
    //is 5 (this is administrator) 
    if($_GET[user]) 

    //checks to see if there is a ?user=username variable in the url. 
    if (!$_POST[update]) 

    // the form hasn't been submitted.  We continue... 
    $user mysql_query("SELECT * from users where username = '$_GET[user]'"); 
    $user mysql_fetch_array($user); 
    //these lines get the user's information and put it in an array. 
    //we will display the information in the html form 
    echo(
    <div align=\"center\"><form method=\"POST\"> 
    <table width=\"100%\"> 
    <tr> 
    <td align=\"right\" width=\"25%\"> 
    User Level  
    </td> 
    <td align=\"left\"> 
    <input type=\"text\" size=\"25\" maxlength=\"25\" name=\"level\" 
    value=\"
    $user[level]\"></td> 
    </tr> 
    <tr> 
    <td align=\"right\" width=\"25%\"> 
    Location  
    </td> 
    <td align=\"left\"> 
    <input type=\"text\" size=\"25\" maxlength=\"25\" name=\"locate\" 
    value=\"
    $user[location]\"></td> 
    </tr> 
    <tr> 
    <td align=\"right\" width=\"25%\"> 
    MSN Messenger  
    </td> 
    <td align=\"left\"> 
     <input size=\"25\" name=\"msn\" value=\"
    $user[msn]\"></td> 
    </tr> 
    <tr> 
    <td align=\"right\" width=\"25%\"> 
    AOL Messenger</td> 
    <td align=\"left\"> 
     <input size=\"25\" name=\"aim\"  value=\"
    $user[aim]\"></td> 
    </tr> 
    <tr> 
    <td align=\"right\" width=\"25%\"> 
    Email Address</td> 
    <td align=\"left\"> 
     <input size=\"25\"  name=\"email\" value=\"
    $user[email]\"></td> 
    </tr> 
    <tr> 
    <td align=\"center\"> 
     </td> 
    <td align=\"left\"> 
     <input type=\"submit\" name=\"update\" value=\"Update\"></td> 
    </tr> 
    </table> 
    </form> 
    </div>"
    ); 
    //displays the html form 

    else 

    $email htmlspecialchars($_POST[email]); 
    $aim htmlspecialchars($_POST[aim]); 
    $msn htmlspecialchars($_POST[msn]); 
    $locate htmlspecialchars($_POST[locate]); 
    $level htmlspecialchars($_POST[level]); 
    // the above lines get rid of all html. 
    echo ("$_GET[user]'s profile has been updated."); 
    $update mysql_query("Update users set email = '$email', 
    msn = '
    $msn', aim = '$aim', 
    location = '
    $locate', level = '$level' where username = '$_GET[user]'"); 
    // updates the information in the database. 


    else 

    $getusers mysql_query("Select * from users order by username asc"); 
    while(
    $users mysql_fetch_array($getusers)) 

    //makes a list of all the users 
    echo("<a href=\"admin.php?user=$users[username]\">$users[username]</a><br />"); 
    //displays the user's names 



    else 

    //the user's level is not 5!  They cannot view this page 
    echo("Sorry, but you are not allowed to view this page!"); 

    ?>
    Extension...
    You can make other pages using this code.

    PHP Code:
    <? 
    ob_start
    (); 
    include(
    "config.php"); 
    if(
    $logged[username] && $logged[level] == 5

    echo(
    "Welcome $logged[username].  Your level is 5"); 

    else 

    echo(
    "You are not logged in, or your level is not 5!"); 

    ?>
    That concludes the tutorial.. Please note that this is for advanced members only... Yet is really easy to make.. You must know how to use phpmyadmin

    this tutorial was from www.techtuts.com it was in four seperate parts which i put together and made this I started it at 18:01 so i guess it didnt take em that long to put together Unless you have a good knowledge of php DONT mod anything.. If you need aa hand pm me and i will be happy to help

  2. #2
    Join Date
    Jun 2005
    Location
    Manchester
    Posts
    3,187
    Tokens
    0

    Latest Awards:

    Default

    Very nice.

    Although you didn't write it, you followed four tutorials and put them together and also edited quite a bit so basically it is your tutorial

    - Dan //

  3. #3
    Join Date
    Jul 2005
    Location
    Bristol
    Posts
    2,054
    Tokens
    -10

    Latest Awards:

    Default

    Mhm i guess, Although Credit to Naresh on Techtus.com

    EDIT: Its too long, i don't think anyone can b bothered to read it...

  4. #4
    Join Date
    Jul 2005
    Location
    Bristol
    Posts
    2,054
    Tokens
    -10

    Latest Awards:

    Default

    Pffft, ignorant people.....

  5. #5
    Join Date
    Nov 2005
    Location
    Warks, Nuneaton
    Posts
    44
    Tokens
    0

    Default

    its good, but its not ur own sorry ;] well done to techtuts.com ;]
    Craig. Hah You Call JackHB A Chav! Look At You ;]
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

    Click Here To View Forum Rules
    Click Here To View Trading Rules
    Click Here To View Graphics Rules
    Click Here To View Reputation Points Information




  6. #6
    Join Date
    Feb 2005
    Posts
    1,411
    Tokens
    0

    Latest Awards:

    Default

    Its good wd. W00t w00t i will use it .
    I owe rep to:

    NintendoNews & Luckyrare

  7. #7
    Join Date
    Jul 2005
    Location
    Bristol
    Posts
    2,054
    Tokens
    -10

    Latest Awards:

    Default

    Lol if people want, They can Pm me and i will set it up on there sites.. Only the basic tutorial, they can then mod it how they want

  8. #8
    Join Date
    Oct 2004
    Location
    Derby
    Posts
    790
    Tokens
    1,148

    Latest Awards:

    Default

    Not a bad tut, Although it's a bit too long for me, if I had the time I would do it. Wd



    People who I respect

    RichardKnox | Nets | JoeComins | Raremandan | Embrace | Css | Encryptions!

    I love Christmas too much - Im looking forward to it already!

  9. #9
    Join Date
    Jul 2005
    Location
    Bristol
    Posts
    2,054
    Tokens
    -10

    Latest Awards:

    Default

    Quote Originally Posted by Embraces
    Lol if people want, They can Pm me and i will set it up on there sites.. Only the basic tutorial, they can then mod it how they want

    ;P

  10. #10
    Join Date
    Feb 2005
    Posts
    1,411
    Tokens
    0

    Latest Awards:

    Default

    Made it and it works perfectly, well done. Stick it. + rep.
    I owe rep to:

    NintendoNews & Luckyrare

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •