Junior Spellweaver
- Joined
- Jun 8, 2012
- Messages
- 195
- Reaction score
- 5
PHP:
<?php
include('config.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" />
<link href="<?php echo $design; ?>/style.css" rel="stylesheet" title="Style" />
<?php
$n="my_variable_{$userid}_name";
${$n} = true;
?>
</head>
<body>
<div class="header">
<a href="<?php echo $url_home; ?>"><img src="<?php echo $design; ?>/images/logo.png" alt="Members Area" /></a>
</div>
<?php
//We check if the user is logged
if(isset($_SESSION['username']))
{
//We check if the form has been sent
if(isset($_POST['username'], $_POST['password'], $_POST['passverif'], $_POST['email'], $_POST['avatar']))
{
if (!$user_row)
{
// User does not exist
}?>
</div>
<?php
}
}
else
{
?>
<div class="message">To access this page, you must be logged.<br />
<a href="connexion.php">Log in</a></div>
<?php
}
?>
<?php
/* Database Connection (MySQLi) */
$conn =new mysqli('localhost','root','fartface1','habbocreds');
$query = $conn->query("SELECT * FROM users WHERE id = '" . $userid . "'");
$result = $query->fetch_assoc();
/* Make Database Into Variables */
$ID = $result['id'];
$Username = $result['username'];
$Password = $result['password'];
$Email = $result['email'];
$NoCredits = $result['credits'];
/* Display */
// echo($ID); // ID
// echo($Username); // Username
// echo($Password); // Password
// echo($Email); // Email
echo($NoCredits);
?>
<div class="foot"><a href="<?php echo $url_home; ?>">You Have <?php echo($NoCredits);?> credits available to spend!
</html>
with the $userid variable i haven't actually set a variable for it, das i dopnt know how to set a variable to get user id
everything else seems to be working but without the variable the credits count wont appear on a page