Nieuw lid |
|
Ik heb dit:
<?php
error_reporting(E_ALL);
// include/require hier evt nog andere zaken
require "connect.php";
// we willen op deze pagina gebruik maken van beveiliging mbv sessies,
// dus includen (requiren) we session.php
require"session.php";
?>
<html>
<head>
<link rel="stylesheet" type="text/css" href="style.css">
<title></title>
</head>
<body>
<p><?php include("./bar.php"); ?></p>
<?php
$item = $_GET['item'];
$prijs = $_GET['item'] . '_prijs';
$skill = $_GET['item'] . '_skill';
$hallo_prijs = 2500;
$hallo_skill = 10;
$sql = "SELECT * FROM users WHERE name = '" . $_SESSION['suser'] . "'";
$res = mysql_query($sql) or trigger_error(mysql_error());
if (mysql_num_rows($res) == 1)
{
$row = mysql_fetch_array($res);
if ($row['money'] == $prijs)
{
$money = $row['money'] - $prijs;
$newskill = $row['skill'] + $skill;
if($money != abs($money))
echo '<p class="content">Je hebt niet genoeg geld!</p>';
else
{
mysql_query("UPDATE users SET money = '" . $money . "' AND skill = '" . $newskill . "' AND " . $item . " = 1 WHERE name = '" . $_SESSION['suser'] . "'") or trigger_error(mysql_error());
echo '<p class="content">Item is gekocht!</p>';
}
}
}
?>
</body>
</html>
<?php // include/require hier evt nog andere zaken require "connect.php"; // we willen op deze pagina gebruik maken van beveiliging mbv sessies, // dus includen (requiren) we session.php require"session.php"; ?> <html> <head> <link rel="stylesheet" type="text/css" href="style.css"> <title></title> </head> <body> <p><?php include("./bar.php"); ?></p> <?php $item = $_GET['item']; $prijs = $_GET['item'] . '_prijs'; $skill = $_GET['item'] . '_skill'; $hallo_prijs = 2500; $hallo_skill = 10; $sql = "SELECT * FROM users WHERE name = '" . $_SESSION['suser'] . "'"; { if ($row['money'] == $prijs) { $money = $row['money'] - $prijs; $newskill = $row['skill'] + $skill; if($money != abs($money)) echo '<p class="content">Je hebt niet genoeg geld!</p>'; else { mysql_query("UPDATE users SET money = '" . $money . "' AND skill = '" . $newskill . "' AND " . $item . " = 1 WHERE name = '" . $_SESSION['suser'] . "'") or trigger_error(mysql_error()); echo '<p class="content">Item is gekocht!</p>'; } } } ?> </body> </html>
Maar ik krijg alleen bar.php geinclude, wat doe ik fout?
|