ja, jeg har et problem med mit "halv" hjemmelaved forum (lavet ud fra skitse)
http://www.jkay.dk/forum/message.php?id=19her kan i se det.
den opstiller åbenbart indlæggende efter tid, og ikke efter ID
<?php
session_start();
?>
<html>
<body>
<link rel="stylesheet" type="text/css" href="http://www.jkay.dk/Layout.css">
<?php
if(isset($_SESSION['myusername'], $_SESSION['mypassword'])) {
?>
<?php
$bsername = $_SESSION['myusername'];
?>
<div class="loginas">
Logget ind som:
<?php
echo "$bsername";
?>
<div class="logout"><a href="http://www.jkay.dk/logout.php">Log ud</a></div></div><br><br><br>
<?php
}else{
?>
<div class =logint>
<form name="form1" method="post" action="http://www.jkay.dk/checklogin.php">
<strong>Member Login </strong><br>
Brugernavn: <input name="myusername" type="text"><br>
Brugerkode: <input name="mypassword" type="password"><br>
<input type="submit" name="Submit" value="Login"><br>
<a href="http://www.jkay.dk/opret.html">Create an account</a>
</form>
</div>
<?php
}
?>
<div class="menu">
<div class="menutekst">
<a href="http://www.jkay.dk/main_login.php">Forside</a> <a href="#">Andet</a> <a href="http://www.jkay.dk/Forum/index.php">Forum</a> <a href="#####">Kontakt</a>
</div>
</div>
<br><br>
<?php
if(isset($_SESSION['myusername'], $_SESSION['mypassword'])){
include "connect.php"; //mysql db connection here
$id=$_GET['id'];
?>
<div class="backog">
<?php
print "<A href='index.php'>Tilbage til Forum</a> <A href='post.php'>Nyt Emne</a> <A href='reply.php?id=$id'>Svar<br>";
?></div>
<?php
print "<table class='maintable'>";
print "<tr class='headline'><td width=20%>Author</td><td width=80%>Post</td></tr>";
$gettopic="SELECT * from forumtutorial_posts where postid='$id'";
$gettopic2=mysql_query($gettopic) or die("Could not get topic");
$gettopic3=mysql_fetch_array($gettopic2);
print "<tr class='mainrow'><td valign='top'>$gettopic3[author]</td><td vakign='top'>posten er skrevet: $gettopic3[showtime]<br><hr>";
$message=strip_tags($gettopic3['post']);
$message=nl2br($message);
print "$message<hr><br>";
print "</td></tr>";
$getreplies="Select * from forumtutorial_posts where parentid='$id' order by postid desc"; //getting replies
$getreplies2=mysql_query($getreplies) or die("Could not get replies");
while($getreplies3=mysql_fetch_array($getreplies2))
{
print "<tr class='mainrow'><td valign='top'>$getreplies3[author]</td><td vakign='top'>Last replied to at $getreplies3[showtime]<br><hr>";
$message=strip_tags($getreplies3['post']);
$message=nl2br($message);
print "$message<hr><br>";
print "</td></tr>";
}
print "</table>";
}
?>
</body>
</html>
Her er koden til den side i ser:
I kan logge ind med:
Brugernavn: udv
brugerkode: udv