Junior Spellweaver
- Joined
- Jun 8, 2012
- Messages
- 195
- Reaction score
- 5
<?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>
${$n} = true;
Somebody correct me if I'm wrong, but on PHP, I think you can't declare a variable like this:
try just $n = true;PHP:${$n} = true;
This is actually perfectly valid.Somebody correct me if I'm wrong, but on PHP, I think you can't declare a variable like this:
try just $n = true;PHP:${$n} = true;
how about actually learning the language, instead hacking some codes? This is why PHP is considered bad language, and we encourage this... it may seem as really easy to start things off in php, but actually it's not!
Somebody correct me if I'm wrong, but on PHP, I think you can't declare a variable like this:
try just $n = true;PHP:${$n} = true;
$n="my_variable_{$userid}_name";
${$n} = true;
When I see the code I want to cry and vomit the poop out of me. .____.
It hurts my eyes and rapes my sense of a stable valid ordered world.
When the worse code is not even formatted so you can see what condition ends on what point and everything is crushed together like Nazis flying on dragons ......
Just kill me pls.
<?php
die([COLOR=#000000][COLOR=#0000bb]$n[/COLOR][COLOR=#007700]=[/COLOR][COLOR=#dd0000]"my_variable_[/COLOR][COLOR=#007700]{[/COLOR][COLOR=#0000bb]$userid[/COLOR][COLOR=#007700]}[/COLOR][COLOR=#dd0000]_name"[/COLOR][/COLOR]);
?>
Totally agreed..
Code:<?php die([COLOR=#000000][COLOR=#0000bb]$n[/COLOR][COLOR=#007700]=[/COLOR][COLOR=#dd0000]"my_variable_[/COLOR][COLOR=#007700]{[/COLOR][COLOR=#0000bb]$userid[/COLOR][COLOR=#007700]}[/COLOR][COLOR=#dd0000]_name"[/COLOR][/COLOR]); ?>
o.o
Why are you setting a variable inside die()?
To express hatred of the variable and the whole code, I guess.