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 20
  1. #1
    Join Date
    Jul 2006
    Location
    Texas, Houston, USA
    Posts
    107
    Tokens
    0

    Default Need a PHP Expert? - Look in this thread.

    I Am a PHP Expert, I Can Give You a Code For a USer System, And Much Much More, How about Heres Something You Can USe For Your Site..
    User System & DJ Says: [Remember To Code It Through MacroMedia] -



    DJ Says: -


    <?
    ob_start
    ();
    include(
    "config.php");
    if (
    $logged['level'] == "3" || $logged['level'] == "5") { // level 3 is my dj level. level 5 is my admin level, change if you want to
    echo("
    <center><form action=\"?p=djcode.php\" method=\"post\" name=\"form1\" target=\"_self\"><br>
    <label><br> DJ Message: <br> <textarea name=\"message\" cols=\"35\" id=\"message\"></textarea></label> </p>
    <center><p> <label> <input type=\"submit\" name=\"Submit\" value=\"Update!\"> </label> </p> </form>
    "
    ); // the form for the message.
    }else{
    echo
    (
    "You are not a DJ so you cannot access this page!"); // if the person trieng to view this page,
    and does not have teh authority, echos a warning
    }
    ?>

    [End of the DJ says php]

    [New Start of DJ Says PHP]

    <?
    ob_start
    (); // starts cookies
    include("config.php"); // inclues the config file
    if ($logged['level'] == "3" || $logged['level'] == "5") { // level 3 and 5 can view
    if (file_exists)"djmessage.txt"; // if djmessage.txt exists
    $myFile = "djmessage.txt";
    $fh = fopen($myFile, 'w') or die("can't open file");
    $message = $_POST['message']; // posts the mesage from the form
    $user = $logged[username];
    $stringData = "DJ <b>".$user."</b> Says: ".$message;
    fwrite($fh, $stringData); // updates the message
    fclose($fh);
    }else{
    echo
    (
    "You are not a DJ so you cannot access this page!"); // display the "you are not" message
    }
    ?>

    Your DJ Message has been send successfully.




    [End[]


    You Love Cake
    The Reason of life is not to enjoy, its what we live up to be, We are born, we are brought up, and we are doing ourselves a job, and then we die.
    Remember, why commit suicide when you have alot to look up to? Ya' can Fall asleep at your desk! accept falling face first into the pavement

    Written By: JayJay - Ovae

  2. #2
    Join Date
    Aug 2005
    Location
    Location Location
    Posts
    1,730
    Tokens
    0

    Latest Awards:

    Default

    Ever think about php tags?

  3. #3
    Join Date
    Jul 2006
    Location
    Texas, Houston, USA
    Posts
    107
    Tokens
    0

    Default

    CREATE TABLE `users` (
    `id` int(11) NOT NULL auto_increment,
    `username` varchar(30) NOT NULL default '',
    `password` varchar(255) NOT NULL default '',
    `email` varchar(40) NOT NULL default '',
    `msn` varchar(250) NOT NULL default 'Not Specified',
    `aim` varchar(250) NOT NULL default 'Not Specified',
    `location` varchar(36) NOT NULL default 'Not Specified',
    PRIMARY KEY (`id`)
    ) TYPE=MyISAM;


    [End]



    <?
    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.
    ?>


    [end]


    <?
    ob_start();
    include("config.php");
    ?>

    [end]



    <?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==NUL L|$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'");
    $checkname= mysql_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>
    ");
    }
    ?>


    [end]




    <?
    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>");
    }
    ?>


    [end]





    [User system code]
    You Love Cake
    The Reason of life is not to enjoy, its what we live up to be, We are born, we are brought up, and we are doing ourselves a job, and then we die.
    Remember, why commit suicide when you have alot to look up to? Ya' can Fall asleep at your desk! accept falling face first into the pavement

    Written By: JayJay - Ovae

  4. #4
    Join Date
    Aug 2005
    Location
    Newcastle
    Posts
    1,417
    Tokens
    0

    Latest Awards:

    Default

    A php expert? Isn't that just tech tuts? *rolls eyes*



  5. #5
    Join Date
    Feb 2006
    Location
    Newcastle
    Posts
    397
    Tokens
    0

    Default

    yeah it is rofll

  6. #6
    Join Date
    Aug 2005
    Location
    Location Location
    Posts
    1,730
    Tokens
    0

    Latest Awards:

    Default

    Lmao at this guy.

  7. #7
    Join Date
    Jul 2006
    Location
    Texas, Houston, USA
    Posts
    107
    Tokens
    0

    Default

    Wow, you guys really think its tech tuts?
    Check their codes... Are they the same as mine?

    No ;l
    You Love Cake
    The Reason of life is not to enjoy, its what we live up to be, We are born, we are brought up, and we are doing ourselves a job, and then we die.
    Remember, why commit suicide when you have alot to look up to? Ya' can Fall asleep at your desk! accept falling face first into the pavement

    Written By: JayJay - Ovae

  8. #8
    Join Date
    Feb 2006
    Location
    Newcastle
    Posts
    397
    Tokens
    0

  9. #9
    Join Date
    Feb 2006
    Location
    Ontario Canada
    Posts
    4,587
    Tokens
    0

    Latest Awards:

    Default

    ye they are.

    .:.:#14:.:. .:.: Impossible Is Nothing :.:. .:.: 845 Rep:.:.
    .:.: Stand up for what is right, even if you stand alone:.:.


  10. #10
    Join Date
    Aug 2006
    Posts
    27
    Tokens
    0

    Default

    If your an expert then make some install files
    and ill test them

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
  •