Nieuw lid |
|
Dit script:
<!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=iso-8859-1" />
<title>Spirit Harvest Talk</title>
</head>
<?php
session_start();
error_reporting(E_ALL);
include("connect.php");
if(isset($_GET['iTalk'])) {
$iTalk = $_GET['iTalk'];
$sql = "SELECT * FROM TalkTopics WHERE TopicName = '".$iTalk."' ";
$result = mysql_query($sql)or die(mysql_error());;
$rij = mysql_fetch_assoc($result);
echo $rij['TopicName'];
echo "<br /><br />";
echo $rij['TopicContent'];
echo "<br /><br />";
?>
<a href="javascript:history.back(1)">back</a>
<?php
}
else
{
$sql = 'SELECT * FROM TalkTopics';
$result = mysql_query($sql)or die(mysql_error());;
$count = mysql_num_rows($result);
if($count < 20) {
while($rij = mysql_fetch_assoc($result);
echo "<a href=\"/talk.php?iTalk=" . $rij['TopicName'] . "\" />" . $rij['TopicName'] . "</a>";
echo "<br />";
echo $rij['TopicContent'];
}
}
?>
<script type="text/javascript">
function loguit()
{
r = confirm("Are you sure you want to log out?");
if(r == true) {
window.location="/talk.php?delsession";
}
}
</script>
<a href="#" onclick="loguit()">Log out</a>
<?php
if(isset($_GET['delsession'])) {
session_destroy();
echo "logged out";
}
?>
<body>
</body>
</html>
<!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=iso-8859-1" /> <title>Spirit Harvest Talk</title> </head> <?php include("connect.php"); if(isset($_GET['iTalk'])) { $iTalk = $_GET['iTalk']; $sql = "SELECT * FROM TalkTopics WHERE TopicName = '".$iTalk."' "; echo $rij['TopicContent']; ?> <a href="javascript:history.back(1)">back</a> <?php } else { $sql = 'SELECT * FROM TalkTopics'; if($count < 20) { echo "<a href=\"/talk.php?iTalk=" . $rij['TopicName'] . "\" />" . $rij['TopicName'] . "</a>"; echo $rij['TopicContent']; } } ?> <script type="text/javascript"> function loguit() { r = confirm("Are you sure you want to log out?"); if(r == true) { window.location="/talk.php?delsession"; } } </script> <a href="#" onclick="loguit()">Log out</a> <?php if(isset($_GET['delsession'])) { } ?> <body> </body> </html>
ik krijg geen errors, maar een leeg scherm.
wat is er fout aan dit script?
|