This is all my php code on forums page. The problem is that i can not think of a way to tell the computer what link they clicked on to get the (thread)id number from the database. Am i just missing somthing or do i totally need to adjust some things? The database holds an auto increment id number, username, topic, body, date. The date isnt working yet, not to worried about it right now. I am just confused and I have the showthread.php but have no clue on what i need in it to get the info. I think i need to get some sleep 🙂
<?php
if (isset($_COOKIE["username"]) && ($_COOKIE["password"]))
{
$user=$_COOKIE["username"];
echo "<table border='0' align='center' width='75%'><tr><td bgcolor='#6B808A'>";
echo "<h2><center>Welcome " . $user . "</center></h2></td></tr></table><br>";
echo "<table border='1' align='center' width='75%'>";
echo "<tr>";
echo "<th>Posted By:</th>";
echo "<th>Topic:</th>";
echo "</tr>";
$db = mysql_connect("localhost", "Admin");
mysql_select_db("testy",$db);
$post = "SELECT username FROM post";
$post2 = mysql_query($post);
$num=mysql_num_rows($post2);
$i=0;
$l=1;
while ($i<$num)
{
$username="SELECT username FROM post WHERE id='$l'";
$username2=mysql_query($username);
$username3=mysql_fetch_array($username2);
$topic="SELECT topic FROM post WHERE id='$l'";
$topic2=mysql_query($topic);
$topic3=mysql_fetch_array($topic2);
echo "<tr>";
echo "<td>";
echo $username3['username'];
echo "</td>";
echo "<td> <a href='showthread.php&s=".$s."?threadid=".$threadid."'>".$topic3['topic']."</a>";
echo "</td>";
echo "</tr>";
$i=$i+1;
$l=$l+1;
}
echo "</table>";
}
else
{
echo "You must register and/or login!";
}
?>