Results 1 to 5 of 5
  1. #1
    Join Date
    May 2006
    Location
    Hull
    Posts
    7,701
    Tokens
    2,430
    Habbo
    Moh

    Latest Awards:

    Default Needing User System Help.

    Well, Its not realy a user system, its just a Staff Profile thing.
    The Content of the File is what isnt working.

    A Demo is here.
    http://www.crazyhabbo.net/profile/login.php
    User: Demo
    Pass: demo

    The Edit Profile isnt saving.
    The content of the file is below
    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%\"> 
    <b>
      <font size=\"1\" face=\"Verdana\">Habbo Name:</font></b></td> 
    <td align=\"left\"> 
     <input type=\"text\" size=\"25\" maxlength=\"25\" name=\"habboname\" value=\"
    $profile[habboname]\"></td> 
    </tr> 
    <tr> 
    <td align=\"right\" width=\"25%\"> 
    <b>
      <font size=\"1\" face=\"Verdana\">Forum Name:</font></b></td> 
    <td align=\"left\"> 
     <input size=\"25\" name=\"forumname\" value=\"
    $profile[forumname]\"></td> 
    </tr> 
    <tr> 
    <td align=\"right\" width=\"25%\"> 
    <b>
      <font size=\"1\" face=\"Verdana\">Age:</font></b></td> 
    <td align=\"left\"> 
     <input size=\"25\" name=\"age\"  value=\"
    $profile[age]\"></td> 
    </tr> 
    <tr> 
    <td align=\"right\" width=\"25%\"> 
    <b>
      <font size=\"1\" face=\"Verdana\">Main Hotel:</font></b></td> 
    <td align=\"left\"> 
     <input size=\"25\"  name=\"hotel\" value=\"
    $profile[hotel]\"></td> 
    </tr> 
    <tr>
    <td align=\"right\" width=\"25%\"> 
    <b>
      <font size=\"1\" face=\"Verdana\">Gender:</font></b></td> 
    <td align=\"left\"> 
     <input size=\"25\"  name=\"gender\" value=\"
    $profile[gender]\"></td> 
    </tr>
    <tr>
    <td align=\"right\" width=\"25%\"> 
    <b>
      <font size=\"1\" face=\"Verdana\">Favourite Song:</font></b></td> 
    <td align=\"left\"> 
     <input size=\"25\"  name=\"favouritesong\" value=\"
    $profile[favouritesong]\"></td> 
    </tr>
    <tr>
    <td align=\"right\" width=\"25%\"> 
    <b>
      <font size=\"1\" face=\"Verdana\">Favourite Genre:</font></b></td> 
    <td align=\"left\"> 
     <input size=\"25\"  name=\"favouritegenre\" value=\"
    $profile[favouritegenre]\"></td> 
    </tr>
    <tr>
    <td align=\"right\" width=\"25%\"> 
    <b>
      <font size=\"1\" face=\"Verdana\">Favourite CH Management:</font></b></td> 
    <td align=\"left\"> 
     <input size=\"25\"  name=\"favmanagement\" value=\"
    $profile[favmangement]\"></td> 
    </tr>
    <tr>
    <td align=\"right\" width=\"25%\"> 
    <b>
      <font size=\"1\" face=\"Verdana\">Best Habbo Friend:</font></b></td> 
    <td align=\"left\"> 
     <input size=\"25\"  name=\"besthabbofriend\" value=\"
    $profile[besthabbofriend]\"></td> 
    </tr>
    <tr>
    <td align=\"right\" width=\"25%\"> 
    <b>
      <font size=\"1\" face=\"Verdana\">Best Real Friend:</font></b></td> 
    <td align=\"left\"> 
     <input size=\"25\"  name=\"bestfriend\" value=\"
    $profile[bestfriend]\"></td> 
    </tr>
    <tr>
    <td align=\"right\" width=\"25%\"> 
    <b>
      <font size=\"1\" face=\"Verdana\">Interests:</font></b></td> 
    <td align=\"left\"> 
     <input size=\"25\"  name=\"interests\" value=\"
    $profile[interests]\"></td> 
    </tr>
    <tr>
    <td align=\"right\" width=\"25%\"> 
    <b><font face=\"Verdana\" size=\"1\">About You:</font></b></td> 
    <td align=\"left\"> 
     <input size=\"25\"  name=\"about\" value=\"
    $profile[about]\"></td> 
    </tr>
    <tr> 
    <td align=\"center\"> 
     &nbsp;</td> 
    <td align=\"left\"> 
     <input type=\"submit\" name=\"update\" value=\"Update\"></td> 
    </tr> 
    </table> 
    </form> 
    </center>
    "
    ); 

    else 

    $habboname htmlspecialchars($_POST[habboname]); 
    $forumname htmlspecialchars($_POST[forumname]); 
    $age htmlspecialchars($_POST[age]); 
    $hotel htmlspecialchars($_POST[hotel]); 
    $gender htmlspecialchars($_POST[gender]); 
    $favouritesong htmlspecialchars($_POST[favouritesong]); 
    $favouritegenre htmlspecialchars($_POST[favouritegenre]); 
    $favmanagement htmlspecialchars($_POST[favmanagement]); 
    $besthabbofriend htmlspecialchars($_POST[besthabbofriend]); 
    $bestfriend htmlspecialchars($_POST[bestfriend]); 
    $interests htmlspecialchars($_POST[interests]); 
    $about htmlspecialchars($_POST[about]); 
    // the above lines get rid of all html. 
    echo ("<font face=\"Verdana\" size=\"1\">Your profile has been updated!</font>"); 
    $update mysql_query("habboname = '$habboname', forumname = '$forumname', age = '$age', hotel = '$hotel', gender = '$gender', favouritesong = '$favouritesong', favouritegenre = '$favouritegenre', favmanagement = '$favmanagement', besthabbofriend = '$besthabbofriend', bestfriend = '$bestfriend', interests = '$interests', about = '$about' where username = '$logged[username]'"); 
    // updates the information in the database. 


    else 

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

    ?> 
    <body link="#000000" vlink="#000000" alink="#000000">
    Can any one find the problem and like send me a fixed file?
    Also.... If you need the mysql file, ill send u the user bit

  2. #2
    Join Date
    Nov 2006
    Location
    North Carolina, UA
    Posts
    128
    Tokens
    0

    Default

    Your using thinkhabbo's 404 page....
    ---------------
    I also use the account: Dentafrice
    ---------------

  3. #3
    Join Date
    Aug 2004
    Location
    bristol
    Posts
    3,799
    Tokens
    0

    Latest Awards:

    Default

    PHP Code:
    <?php

     define
    ("TABLE_NAME""userprofiles"); // Table name for the profiles?

     
    ob_start(); 
     require(
    "config.php");


     function 
    sanitize($str)
     {
       if (
    get_magic_quotes_gpc()) {
         
    $str stripslashes($str);
       }

       
    $str htmlentities($str);
       return 
    mysql_real_escape_string($str);
     }


     function 
    insert_field(&$value)
     {
       
    $SQL sprintf("UPDATE `%s` SET `%s` = '%s' WHERE user = '%s'",
                       
    TABLE_NAME,
                       
    $value,
                       
    sanitize($_POST[$value]),
                       
    sanitize($logged['username']));

       
    mysql_query($SQL);
     }


     if(
    $logged['username'] && !$_POST['update']) {

      
    $SQL mysql_query("SELECT * from `users` where `username` = '$logged[username]'");
      
    $profile mysql_fetch_array($SQL);

        print <<<HTML

        <center><form method="POST">

        <table width="100%">

          <tr>
            <td align="right" width="25%" style="font-weight: bold; font: 12px verdana;">Habbo Name:</td> 
            <td align="left"><input type="text" size="25" maxlength="25" name="habboname" value="
    {$profile['habboname']}" /></td>
          </tr>

          <tr> 
            <td align="right" width="25%" style="font-weight: bold; font: 12px verdana;">Forum Name:</td> 
            <td align="left"><input size="25" name="forumname" value="
    {$profile['forumname']}" /></td> 
          </tr>

          <tr> 
            <td align="right" width="25%" style="font-weight: bold; font: 12px verdana;">Age:</td> 
            <td align="left"><input size="25" name="age"    value="
    {$profile['age']}" /></td>
          </tr>

          <tr>
            <td align="right" width="25%" style="font-weight: bold; font: 12px verdana;">Main Hotel:</td> 
            <td align="left"><input size="25" name="hotel" value="
    {$profile['hotel']}" /></td>
          </tr>

          <tr>
            <td align="right" width="25%" style="font-weight: bold; font: 12px verdana;">Gender:</td> 
            <td align="left"><input size="25" name="gender" value="
    {$profile['gender']}" /></td>
          </tr>

          <tr>
            <td align="right" width="25%" style="font-weight: bold; font: 12px verdana;">Favourite Song:</td> 
            <td align="left"><input size="25" name="favouritesong" value="
    {$profile['favouritesong']}" /></td> 
          </tr>

          <tr>
            <td align="right" width="25%" style="font-weight: bold; font: 12px verdana;">Favourite Genre:</td> 
            <td align="left"><input size="25" name="favouritegenre" value="
    {$profile['favouritegenre']}" /></td> 
          </tr>

          <tr>
            <td align="right" width="25%" style="font-weight: bold; font: 12px verdana;">Favourite CH Management:</td> 
            <td align="left"><input size="25" name="favmanagement" value="
    {$profile['favmangement']}" /></td> 
          </tr>

          <tr>
            <td align="right" width="25%" style="font-weight: bold; font: 12px verdana;">Best Habbo Friend:</td> 
            <td align="left"><input size="25" name="besthabbofriend" value="
    {$profile['besthabbofriend']}" /></td> 
          </tr>

          <tr>
            <td align="right" width="25%" style="font-weight: bold; font: 12px verdana;">Best Real Friend:</td> 
            <td align="left"> <input size="25"    name="bestfriend" value="
    {$profile['bestfriend']}" /></td> 
          </tr>

          <tr>
            <td align="right" width="25%" style="font-weight: bold; font: 12px verdana;">Interests:</td> 
            <td align="left"><input size="25" name="interests" value="
    {$profile['interests']}" /></td> 
          </tr>

          <tr>
            <td align="right" width="25%" style="font-weight: bold; font: 12px verdana;">About You:</td> 
            <td align="left"><input size="25" name="about" value="
    {$profile['about']}" /></td> 
          </tr>

          <tr> 
            <td align="center">&nbsp;</td> 
            <td align="left"><input type="submit" name="update" value="Update"></td> 
          </tr>

        </table>

        </form></center>

    HTML;
    } elseif(
    $logged['username']) {

      
    $load = array('habboname''forumname''age''hotel''gender''favouritesong''favouritegenre',
                    
    'favmanagement''besthabbofriend''bestfriend''interests''about');

      
    array_walk($load'insert_field');

    } else {

      print 
    '<a href="login.php"><font face="Verdana" size="1">You must login</font></a>';

    ?>
    <body link="#000000" vlink="#000000" alink="#000000">
    Haven't tested, and you'll need to change the table name defined at the top.
    kinda quit.

  4. #4

    Default

    you should look on techtuts.com forum, they got a user system which has loads of FAQ's

  5. #5
    Join Date
    May 2005
    Location
    San Francisco, CA
    Posts
    7,160
    Tokens
    2,331

    Latest Awards:

    Default

    He is using techtuts profile system :\

Posting Permissions

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