Moh
25-11-2006, 10:35 PM
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
<?
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\">
</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 :D
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
<?
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\">
</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 :D