Ashoar Posted April 6, 2009 Author Share Posted April 6, 2009 Same result again, but the forumid variable is "$forumid = $_GET['id'];" So it isn't in the test code. Link to comment https://forums.phpfreaks.com/topic/152758-what-is-wrong-here/page/3/#findComment-802321 Share on other sites More sharing options...
phpretard Posted April 6, 2009 Share Posted April 6, 2009 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 https://forums.phpfreaks.com/topic/152758-what-is-wrong-here/page/3/#findComment-802323 Share on other sites More sharing options...
Ashoar Posted April 6, 2009 Author Share Posted April 6, 2009 $forumid = "HARD CODE THIS"; ? Link to comment https://forums.phpfreaks.com/topic/152758-what-is-wrong-here/page/3/#findComment-802330 Share on other sites More sharing options...
phpretard Posted April 6, 2009 Share Posted April 6, 2009 What are expecting forumid to be (value)? $forumid="WHAT"; Link to comment https://forums.phpfreaks.com/topic/152758-what-is-wrong-here/page/3/#findComment-802333 Share on other sites More sharing options...
Ashoar Posted April 6, 2009 Author Share Posted April 6, 2009 Whatever the id for the forum is. So i can't add in anything as i won't know what forum is being viewed, which is why i was using the $_GET to get the id from the url. Link to comment https://forums.phpfreaks.com/topic/152758-what-is-wrong-here/page/3/#findComment-802335 Share on other sites More sharing options...
phpretard Posted April 6, 2009 Share Posted April 6, 2009 what is the url value? somethin.com?id=WHAT Link to comment https://forums.phpfreaks.com/topic/152758-what-is-wrong-here/page/3/#findComment-802341 Share on other sites More sharing options...
Ashoar Posted April 6, 2009 Author Share Posted April 6, 2009 A number. board.php?id=WHAT Number id of the board they are inside. Which is "forum_id" from a database called forum which gold the forum_id, description and name. Link to comment https://forums.phpfreaks.com/topic/152758-what-is-wrong-here/page/3/#findComment-802345 Share on other sites More sharing options...
phpretard Posted April 6, 2009 Share Posted April 6, 2009 When you navigate to the forum you want to display, does something like this show up in your browser yourforum.com?forum_id=123456 Link to comment https://forums.phpfreaks.com/topic/152758-what-is-wrong-here/page/3/#findComment-802353 Share on other sites More sharing options...
Ashoar Posted April 6, 2009 Author Share Posted April 6, 2009 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 https://forums.phpfreaks.com/topic/152758-what-is-wrong-here/page/3/#findComment-802355 Share on other sites More sharing options...
phpretard Posted April 6, 2009 Share Posted April 6, 2009 What forum_id contains: This better work now. Ok almost got this working. Still not working Getting on my nerves Should work now this better work now Link to comment https://forums.phpfreaks.com/topic/152758-what-is-wrong-here/page/3/#findComment-802362 Share on other sites More sharing options...
Ashoar Posted April 6, 2009 Author Share Posted April 6, 2009 posts, contains that not forum_id Link to comment https://forums.phpfreaks.com/topic/152758-what-is-wrong-here/page/3/#findComment-802364 Share on other sites More sharing options...
phpretard Posted April 6, 2009 Share Posted April 6, 2009 $forumid=$_GET['forum_id']; Link to comment https://forums.phpfreaks.com/topic/152758-what-is-wrong-here/page/3/#findComment-802379 Share on other sites More sharing options...
Ashoar Posted April 6, 2009 Author Share Posted April 6, 2009 Just replace all existing GET's to that? EDIT: Using that, the posts are again displayed on every board instead of just the one it was posted on. Link to comment https://forums.phpfreaks.com/topic/152758-what-is-wrong-here/page/3/#findComment-802381 Share on other sites More sharing options...
phpretard Posted April 6, 2009 Share Posted April 6, 2009 Make Copies and comment out... //$forumid=$_GET['id']; $forumid=$_GET['forum_id']; Link to comment https://forums.phpfreaks.com/topic/152758-what-is-wrong-here/page/3/#findComment-802394 Share on other sites More sharing options...
Ashoar Posted April 6, 2009 Author Share Posted April 6, 2009 Still displays posts in all boards instead of just the one it was posted in. Link to comment https://forums.phpfreaks.com/topic/152758-what-is-wrong-here/page/3/#findComment-802400 Share on other sites More sharing options...
phpretard Posted April 6, 2009 Share Posted April 6, 2009 Can I have the url? Link to comment https://forums.phpfreaks.com/topic/152758-what-is-wrong-here/page/3/#findComment-802401 Share on other sites More sharing options...
Ashoar Posted April 6, 2009 Author Share Posted April 6, 2009 It is on my computer, not online. Link to comment https://forums.phpfreaks.com/topic/152758-what-is-wrong-here/page/3/#findComment-802403 Share on other sites More sharing options...
phpretard Posted April 6, 2009 Share Posted April 6, 2009 Could I have the local address? Link to comment https://forums.phpfreaks.com/topic/152758-what-is-wrong-here/page/3/#findComment-802405 Share on other sites More sharing options...
Ashoar Posted April 6, 2009 Author Share Posted April 6, 2009 Sorry i cannot provide that online. So is there no other method of making a post in only a certain board? Link to comment https://forums.phpfreaks.com/topic/152758-what-is-wrong-here/page/3/#findComment-802407 Share on other sites More sharing options...
phpretard Posted April 6, 2009 Share Posted April 6, 2009 So C:\hide_your_stuff\?this_is_what_need_to_see Link to comment https://forums.phpfreaks.com/topic/152758-what-is-wrong-here/page/3/#findComment-802412 Share on other sites More sharing options...
Ashoar Posted April 6, 2009 Author Share Posted April 6, 2009 Sent you a pm with a link to a free host i added it to. Link to comment https://forums.phpfreaks.com/topic/152758-what-is-wrong-here/page/3/#findComment-802417 Share on other sites More sharing options...
roadshow Posted June 22, 2009 Share Posted June 22, 2009 Upload the results so we can check it out. Link to comment https://forums.phpfreaks.com/topic/152758-what-is-wrong-here/page/3/#findComment-861045 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.