Forgot Password / Register
Site Statistics
Total Members: 520
Total Tutorials: 242
Newsest User: 8884244477
Todays Unique Hits: 336
0 Users 8 Guests Online
Forum Index » PHP + MySQL » PLEASE HELP. Complete Noob Que
Posted on Thursday 28th June 2007 at 04:19 PM
-=InSaNe=-
templates/default/images/noavatar.png's Avatar
Junior Member
mmkay, well I am working on a Habbo Fansite (Dont bug me about this.) And I am having problems with 'members.php' + 'editprofile.php'. Everytime I try to add something like 'Habbo Name' or something, it does not update. If someone could either add the following to Members.php + editprofile.php:

Habbo Name
Main Hotel
Favourite Rare
Favourite Norm
Favourite Staff Member
Location
Habbo Homepage

Or atleast explain how I can add those things myself (And yes I did add them to phpMyAdmin but still would not update when I updated in editprofile.php) Thanks in advance!

~ Devon.
Posted on Thursday 28th June 2007 at 05:11 PM
Dean
templates/default/images/noavatar.png's Avatar
Active Member
haveyou added the rows to the database?
Posted on Thursday 28th June 2007 at 05:14 PM
-=InSaNe=-
templates/default/images/noavatar.png's Avatar
Junior Member
Uhh.

Well in phpMyAdin I tried just the Habbo Name, and I did add the line, but for some reason it does not work.
Posted on Thursday 28th June 2007 at 05:18 PM
Dean
templates/default/images/noavatar.png's Avatar
Active Member
insane post your members.php file here and in phpmyadmin remove

Habbo Name
Main Hotel
Favourite Rare
Favourite Norm
Favourite Staff Member
Location
Habbo Homepage

on how ever u did and add


hname
mhotel
frare
fnorm
fsmember
location
hhomepage
Posted on Thursday 28th June 2007 at 07:56 PM
MOD-Dan
templates/default/images/noavatar.png's Avatar
Newbie
at the bottom of edit profile you need to make sure u updated the query to add them in too
Posted on Thursday 28th June 2007 at 08:38 PM
-=InSaNe=-
templates/default/images/noavatar.png's Avatar
Junior Member
I have not placed much of the 'Habbo' stuff in it, because my plan was to make one if it works make the others. Members.php:

<?php
session_start(); //allows session
include "config.php";
echo "<center>";
if ($_POST[submit]) {
$name = strip_tags(htmlspecialchars($_POST["username"]));
$sub = strip_tags(htmlspecialchars($_POST["sub"]));
$comment = strip_tags(htmlspecialchars($_POST["comment"]));
$user = strip_tags(htmlspecialchars($_POST["user"]));
$db = mysql_query("INSERT INTO `guestbook` (`author`, `sub`, `comment`, `puser`) VALUES ('$name','$sub','$comment','$user')") or die(mysql_error());
if(!$db){
echo(" Error Posting Comment ");
}else{
echo(" Comment Posted ");
}
}

if(isset($_GET['user'])){ //if there trying to view a profile
//gets the user name and makes it safe
$username = addslashes($_GET[user]);
//querys the db to find the username
$getuser = mysql_query("SELECT * FROM `members` WHERE `username` = '$username'");
//checks see if the username exists in the db

$usernum = mysql_num_rows($getuser);
//if it don't exist
if ($usernum == 0)

{
//don't exist

echo ("User Not Found");

}
//if it does exist then show there profile
else
{
$user = mysql_fetch_array($getuser);
echo "<fieldset style='width: 350'>
<b>$user[username]'s Profile</b><br><br>
Email: $user[email]<br>
Location: $user[habboname]<br>
Sex: $user[sex]<br>
Age: $user[age]<br>
</fieldset>";
echo("<br><br><font size=\"5\">User Comments</font>");
$guest = mysql_query("SELECT * FROM `guestbook` WHERE `puser` = '" . $user[username] . "'");
while($guestbook = mysql_fetch_array($guest)) {
echo("<br><br>
From: $guestbook[author]<br>
Subject: $guestbook<sub><br>
Comment: <br>
$guestbook[comment]<br><br>");
}
echo("<form method=\"POST\">
Name: <input type=\"text\" name=\"username\" maxlength=\"255\"><br>
Subject: <input type=\"text\" name=\"sub\" maxlength=\"255\"><br>
Comment: <textarea name=\"comment\" rows=\"4\" cols=\"40\"></textarea><br>
<input type=\"hidden\" name=\"user\" value=\"" . $user[username] . "\">
<input type=\"submit\" name=\"submit\" value=\"Post Comment\">
");


}
}
else
{
//gets all the members from the database
$getusers = mysql_query("SELECT * FROM `members` ORDER BY `id` ASC") or die(mysql_error());
//loops there name out
while ($user = mysql_fetch_array($getusers))
{
echo "<a href='members.php?user=$user[username]'>$user[username]</a><br>";
}
}
echo "<center>";
?>

AND I fixed up the phpMyAdmin to those things :D
Posted on Monday 2nd July 2007 at 05:11 AM
gbt91
templates/default/images/noavatar.png's Avatar
Junior Member
O_o maybe i can help you,
i use my system for my Habbo Fansite and it works great
what do you want to add?
Posted on Monday 2nd July 2007 at 04:09 PM
-=InSaNe=-
templates/default/images/noavatar.png's Avatar
Junior Member
gbt91, well I need to get a sweet Members.php + editprofile.php, so you can add some stuff, show furni you bought, pets, and what not :D What site is it?