Jump to content

What is wrong here


Ashoar

Recommended Posts

  • Replies 71
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

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"

Link to comment
Share on other sites

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"

Link to comment
Share on other sites

  • 2 months later...
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • 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.