26.07.2016, 08:44
Hi. How can I center / position player's information where I want?
I was thinking somewith with CSS, but I have a PHP code
and it looks kind of ugly on my page.
http://vestigedayz.com/ucp/
Name: Test011
Password: test
I was thinking somewith with CSS, but I have a PHP code
PHP код:
<?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['username']; //selecting user name, change 'username' to your field name
$money = $row['money']; //selecting user money, change 'money' to your field name
$score = $row['score']; //selecting user score, change 'score' to your field name
$kills = $row['kills']; //selecting user kills, change 'kills' to your field name
$deaths = $row['deaths']; //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: login.php'); //if user isn't loged in it will redirect him on login.php
?>
http://vestigedayz.com/ucp/
Name: Test011
Password: test