[Tutorial] Creating a basic user control panel
#40

Doesn't work for me either. Well, I should say that i got it all working except for the part of it showing the player's info. I have everything set up right, but for some reason this line doesn't work:
Code:
    echo "<br><br>Name: ".$name."<br> Money: ".$money."<br> Score: ".$score."<br> Kills: ".$kills."<br> Deaths: ".$deaths;
Here's my hole part:
Code:
<?php 

include("config.php"); //including our config.php 
session_start(); //starting session 
error_reporting(0); 

if(isset($_SESSION['username'])) //if session is set, so if user is logged in... 
{ 
    $username = $_SESSION['username']; //setting variable username as one from session 
    $query = mysql_query("SELECT * FROM users WHERE username = '$username'");  //selecting all from table users where username is name that your is loged in 
    echo "Welcome ".$_SESSION['username']; //saying welcome to user! 
    while($row = mysql_fetch_assoc($query)) //looping thousgt table to get informations 
    { 
        $name = $row['Name']; //selecting user name, change 'username' to your field name 
        $money = $row['Money']; //selecting user money, change 'money' to your field name 
        $score = $row['PlayerLevel']; //selecting user score, change 'score' to your field name 
        $kills = $row['AdminLevel']; //selecting user kills, change 'kills' to your field name 
        $deaths = $row['Bank']; //selecting user deaths, change 'deaths' to your field name 
    } 
    echo "<br><br>Name: ".$name."<br> Money: ".$money."<br> Score: ".$score."<br> Kills: ".$kills."<br> Deaths: ".$deaths; 
} 
else header('location: index.php'); //if user isn't loged in it will redirect him on login.php 

?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Basic UCP</title>
</head>
</html>
Reply


Messages In This Thread
Creating a basic user control panel - by System64 - 17.10.2011, 09:00
Re: Creating a basic user control panel - by Lorenc_ - 17.10.2011, 09:25
Re: Creating a basic user control panel - by Sinner - 17.10.2011, 09:28
Re: Creating a basic user control panel - by System64 - 17.10.2011, 09:29
Re: Creating a basic user control panel - by Sinner - 17.10.2011, 09:31
Re: Creating a basic user control panel - by System64 - 17.10.2011, 09:39
Re: Creating a basic user control panel - by [HiC]TheKiller - 17.10.2011, 09:42
Re: Creating a basic user control panel - by System64 - 17.10.2011, 10:02
Re: Creating a basic user control panel - by Lorenc_ - 17.10.2011, 10:17
Re: Creating a basic user control panel - by System64 - 17.10.2011, 10:19
Re: Creating a basic user control panel - by GloomY - 17.10.2011, 10:20
Re: Creating a basic user control panel - by System64 - 17.10.2011, 10:33
Re: Creating a basic user control panel - by System64 - 17.10.2011, 18:21
Re: Creating a basic user control panel - by Baboon - 17.10.2011, 20:25
Re: Creating a basic user control panel - by System64 - 17.10.2011, 20:27
Re: Creating a basic user control panel - by XFlawless - 18.10.2011, 10:46
Re: Creating a basic user control panel - by System64 - 18.10.2011, 11:05
Re: Creating a basic user control panel - by XFlawless - 18.10.2011, 12:59
Re: Creating a basic user control panel - by System64 - 18.10.2011, 17:49
Re: Creating a basic user control panel - by DiNorscio - 05.04.2012, 09:23
Re: Creating a basic user control panel - by System64 - 05.04.2012, 09:34
Re: Creating a basic user control panel - by Krunsy - 21.04.2012, 11:32
Re: Creating a basic user control panel - by System64 - 21.04.2012, 13:08
Re: Creating a basic user control panel - by Krunsy - 23.04.2012, 12:46
Re: Creating a basic user control panel - by Ballu Miaa - 23.04.2012, 17:53
Re: Creating a basic user control panel - by System64 - 23.04.2012, 19:58
Re: Creating a basic user control panel - by tiernantheman - 23.04.2012, 20:00
Re: Creating a basic user control panel - by Elysian` - 23.04.2012, 21:51
Re: Creating a basic user control panel - by Ballu Miaa - 24.04.2012, 02:39
Re: Creating a basic user control panel - by System64 - 24.04.2012, 12:08
Re: Creating a basic user control panel - by Claude - 24.04.2012, 15:58
Re: Creating a basic user control panel - by System64 - 24.04.2012, 16:36
AW: Creating a basic user control panel - by xOFxK1LLER - 25.04.2012, 15:32
Re: Creating a basic user control panel - by 3ventic - 26.04.2012, 16:10
Re: Creating a basic user control panel - by Ballu Miaa - 26.04.2012, 16:21
Re: Creating a basic user control panel - by SwiftKidZ - 02.05.2012, 04:12
Re: Creating a basic user control panel - by Gertin - 02.05.2012, 11:11
Re: Creating a basic user control panel - by System64 - 02.05.2012, 11:20
Re: Creating a basic user control panel - by Sanady - 28.09.2012, 14:13
Re: Creating a basic user control panel - by marine - 29.09.2012, 18:06
Re: Creating a basic user control panel - by Mikkel - 08.10.2012, 11:18
Re: Creating a basic user control panel - by ZackBoolaro - 08.10.2012, 11:29
Re: Creating a basic user control panel - by Roel - 25.10.2012, 06:59
Re: Creating a basic user control panel - by gtakillerIV - 25.10.2012, 12:33
Re: Creating a basic user control panel - by Dugzor - 30.09.2013, 20:18
Re: Creating a basic user control panel - by DanishHaq - 30.09.2013, 20:24
Re: Creating a basic user control panel - by logoster - 01.12.2013, 18:04
Re: Creating a basic user control panel - by BizzyD - 01.12.2013, 18:14
Re: Creating a basic user control panel - by thefatshizms - 01.12.2013, 22:16
Re: Creating a basic user control panel - by System64 - 06.12.2013, 19:43
Re: Creating a basic user control panel - by FahadKing07 - 12.12.2013, 20:40
Re: Creating a basic user control panel - by DavidLuango - 13.12.2013, 05:42
Re: Creating a basic user control panel - by Spydah - 21.03.2014, 21:22
Re: Creating a basic user control panel - by Micko123 - 10.05.2016, 06:56
Re: Creating a basic user control panel - by Zorono - 02.06.2016, 18:37
Re: Creating a basic user control panel - by Zeus666 - 25.07.2016, 17:22

Forum Jump:


Users browsing this thread: 1 Guest(s)