im not under-acheiving, we're told to be using cookies =]
Code: Select all
<?php
$student_id=$_GET["student_id"];
$password=$_GET["password"];
$fname=$_GET["fname"];
$sname=$_GET["sname"];
$school=$_GET["school"];
$course=$_GET["course"];
$account=$_GET["account"];
$banned=$_GET["banned"];
$con = mysql_connect("DBHOST", "USERNAME", "PASSWORD");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("DBNAME", $con);
$sql="SELECT * FROM users WHERE Username='".$student_id."' OR Password='".$password."' OR FirstName='".$fname."' OR Surname='".$sname."' OR School='".$school."' OR Framework='".$course."' OR AccountLevel='".$account."' OR Banned='".$banned."';";
echo $sql;
$result = mysql_query($sql, $con);
echo "<table border='1'>
<tr>
<th>Username</th>
<th>First Name</th>
<th>Surname</th>
<th>School</th>
<th>Course</th>
<th>Account</th>
<th>Banned</th>
</tr>";
while($row = mysql_fetch_array($result))
{
echo "<td>" . $row['Username'] . "</td>";
echo "<td>" . $row['FirstName'] . "</td>";
echo "<td>" . $row['Surname'] . "</td>";
echo "<td>" . $row['School'] . "</td>";
echo "<td>" . $row['Framework'] . "</td>";
echo "<td>" . $row['AccountLevel'] . "</td>";
echo "<td>" . $row['Banned'] . "</td>";
echo "</tr>";
}
setcookie("cooksies", "valsies", time()+3600);
$i=0;
while($row = mysql_fetch_array($result))
{
setcookie("Username".$i, $row['Username'], time()+3600);
setcookie("FirstName".$i, $row['FirstName'], time()+3600);
setcookie("Surname".$i, $row['Surname'], time()+3600);
setcookie("School".$i, $row['School'], time()+3600);
setcookie("Framework".$i, $row['Framework'], time()+3600);
setcookie("Account".$i, $row['Account'], time()+3600);
setcookie("Banned".$i, $row['Banned'], time()+3600);
$i++;
}
echo "</table>";
echo "<p>";
echo $_COOKIE["Username0"];
echo $_COOKIE["cooksies"];
echo "HELLO";
echo "</p>";
mysql_close($con);
?>
there's the whole PHP file anyways
i didn't realise you had o refresh, so when i did, that cookie i aptly named 'cooksies' displayed it's value, but the ones within the loop still don't...
and sorry for the barely functional code, im still in testing before i ge into a final one =]