<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Clues</title>
<style type="text/css">
<!--
body {
background-color: #CCCCCC;
}
body,td,th {
color: #000000;
font-family: Arial, Helvetica, sans-serif;
}
.style1 {font-family: "Courier New", Courier, mono}
-->
</style></head>
<body>
<h1>Who Am I? Game</h1>
<h2>Clues</h2>
<hr>
<?php
// Get the 'username' varible from flash
$username = $_POST['username'];
$guessfirstname = $_POST['firstname'];
$guessid = $_POST['id'];
// Start database connection
$dbcnx = @mysql_connect("localhost","alexg_si","password");
if (!$dbcnx) {
echo "<p>Unable to connect to the database server at this time.</p>";
exit();
}
mysql_select_db("alexg_web",$dbcnx);
$result = @mysql_query("SELECT guessed, guessedright FROM whoamipeople WHERE id = '$guessid'");
if (!$result) {
exit("<p>Error performing query: " . mysql_error() . "</p>");
}
// Disply the users Account Details $row["Clue"]
while ($row = mysql_fetch_array($result)) {
$oldguessed = $row["guessed"];
$addingone = '1';
$newguessed = $oldguessed + $addingone;
$oldguessedright = $row["guessedright"];
$newguessedright = $oldguessedright + $addingone;
}
// done adding one
mysql_select_db("alexg_web",$dbcnx);
$resultupdateguess = @mysql_query("UPDATE whoamipeople SET guessed = '$newguessed', guessedright = '$newguessedright' WHERE Firstname = '$guessfirstname'");
$resultupdateguessisitright = @mysql_query("SELECT guessedright FROM whoamipeople WHERE id = '$guessid'");
while ($rowright = mysql_fetch_array($resultupdateguessisitright)) {
$oldguessedrightisitright = $rowright["guessedright"];
if ($oldguessedrightisitright == $newguessedright) {
echo "<p>Thank You, Processing Your Guess.</p>";
$resultupdateguesscorrect = @mysql_query("UPDATE whoamipeople SET score + 100 WHERE Username = '$username'");
echo "<p>Checking if guessed firstname is a match in the Who Am I? Database...</p>";
echo "<p>Yes! That is correct! You have gained 100 points. Check out your Account Info for your score!</p>";
} else {
echo "<p>Checking if guessed firstname is a match in the Who Am I? Database...</p>";
echo "<p>Sorry, that is the incorrect name. Nice Try!</p>";
}
// swich back to html mode to create divider
//
?>
<h6 align="left"><span class="style1">Who Am I? Game is owned and created by Alex Grenier</span></h6>
<h6 align="left" class="style1">This pertictular verion is run by Alexville.com.</h6>
</html>
I get this error:
[!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]
Parse error: parse error, unexpected $ in /home/alexg/public_html/whoami/processguess.php on line 73[/quote]
The werid thing is that the 74 line only contains </html>
Thanks Guys