Jump to content

What is wrong here


Ashoar

Recommended Posts

  • Replies 71
  • Created
  • Last Reply

Your original code:

 


include "config.php"; 

//$forumid = $_GET['id'];

$forumid = "HARD CODE THIS";

print "<link rel='stylesheet' href='style.css' type='text/css'>";

print "<A href='post.php?id=$forumid'>New Topic</a><br>";

print "
<table class='maintable'>

<tr class='headline'><td width=50%>Topic</td>
<td width=20%>Author/td><td>Replies</td>
<td>Last reply</td>
</tr>
";

$info="SELECT * from post_reply where parentid='0' AND forumid='$forumid' ORDER BY lastrepliedto DESC";

$info2=mysql_query($info) or die(mysql_error());

while($info3=mysql_fetch_array($info2))

{

  $info3[title]=strip_tags($info3[title]);

  $info3[author]=strip_tags($info3[author]);

  print "
  <tr class='mainrow'><td><A href='message.php?id=$info3[postid]'>$info3[title]</a></td>
  <td>$info3[author]</td>
  <td>$info3[numreplies]</td>
  <td>$info3[showtime]<br>Last post by <b>$info3[lastposter]</b>
  </td>
  </tr>
  ";

}

print "</table>";

 

 

If you are using "forumid" to identify then make it an "int" and "auto increment" and make it "key"

I have it linked like so

"<A href='board.php?id=$name[forum_id]'>$name[forum_name]"

 

"$name[forum_id]" Ads the id number of the forum

"$name[forum_name]" Name of the forum to be shown on the main page.

 

Which then makes "board.php?id=" whatever number board is being viewed.

So if you clicked on a board that was made 2nd the id would be "board.php?id=2"

  • 2 months later...

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.