Jump to content

loony383

Members
  • Posts

    41
  • Joined

  • Last visited

    Never

Everything posted by loony383

  1. where would i put the query that gets the categorys?
  2. Hi i want to select categorys from the table forumtutorial_cats and then it will select forums from forumtutorial_subforums where catid=the catid from the previous query. in a table it would list the category name then all the forums underneith it then it would list the 2nd categorys name and the forums underneith it. it would keep doing thin until it didn't find any more categorys. i am not sure how i would get it to do this. if someone can write me an example of this i would be very greatful.
  3. Parse error: syntax error, unexpected T_STRING in /home2/airserve/public_html/airboard/post.php on line 82 didn't work, i thought it had to have the math stuff like operators in the line but i don't understand about doing stuff within a bit of code like just putting a operator
  4. Hi i want my code to add 1 to postcount of the user when they make a post on my forum but i dont know how to do this, here is my code can someone please tell me how to do the update thing to add 1 to the users postcount $insertpost="INSERT INTO forumtutorial_posts(author,title,post,showtime,realtime,lastposter,forumid) values('$name','$subject','$yourpost','$displaytime','$thedate','$name','$forumid')"; mysql_query($insertpost) or die("Could not insert post"); //insert post mysql_query(*UPDATE users set 'postcound'=$postcount [$postcount=1]) print "Message posted, go back to <A href='index.php?forumid=$forumid'>Forum</a>."; } thats the part of my code where i want it to update the postcount
  5. It is defined in the seccond script with $forumid = $_GET['forumid']; after you scroll down a bit, thanks for the help but still nothing is working
  6. Hi im trying to make it so veiw_forum.php?forumid=1 displays all the information from the database that has forumid to the value passed in the varible, but my code isnt working <html> <head> <title>Airboard - Beta</title> <?php include ("menu.php"); include "connect.php"; //mysql db connection here $forumid = $_GET['forumid']; print "<link rel='stylesheet' href='style.css' type='text/css'>"; print "<A href='post.php?forumid=$forumid'>New Topic</a>"; print "<table class='maintable'>"; print "<tr class='headline'><td width=50%>Topic</td><td width=20%>Topic Starter</td><td>Replies</td><td>Last replied time</td></tr>"; $getthreads="SELECT * from forumtutorial_posts where parentid='0' and forumid='$forumid' order by realtime DESC"; $getthreads2=mysql_query($getthreads) or die("Could not get threads"); while($getthreads3=mysql_fetch_array($getthreads2)) { $getthreads3[title]=strip_tags($getthreads3[title]); $getthreads3[author]=strip_tags($getthreads3[author]); print "<tr class='mainrow'><td><A href='message.php?id=$getthreads3[postid]'>$getthreads3[title]</td><td>$getthreads3[author]</td><td>$getthreads3[numreplies]</td><td>$getthreads3[showtime] Last post by $getthreads3[lastposter]</td></tr>"; } print "</table>"; ?> instead its showing all the posts not just ones with forumid to 1. Also my 2nd problem is when my post.php?forumid=1 inserts information of the topic to the database it isnt inserting forumid to 1 its leaving it blank, heres my code <?php include("include/session.php"); include "header.php"; include ("menu.php"); function checkLogin() { global $database; if(isset($_COOKIE['cookname']) && isset($_COOKIE['cookid'])) { $this->username = $_SESSION['username'] = $_COOKIE['cookname']; $this->userid = $_SESSION['userid'] = $_COOKIE['cookid']; } } if ($session->username == 'Guest') { echo "You need to login to create a topic"; exit(); } print "<link rel='stylesheet' href='style.css' type='text/css'>"; print "<table class='maintables'>"; print "<tr class='headline'><td>Post a message</td></tr>"; print "<tr class='maintables'><td>"; if(isset($_POST['submit'])) { $name=$session->username; $yourpost=$_POST['yourpost']; $forumid = $_GET['forumid']; $subject=$_POST['subject']; if(strlen($yourpost)<1) { print "You did not type in a post."; //no post entered } else if(strlen($subject)<1) { print "You did not enter a subject."; //no subject entered } else { $thedate=date("U"); //get unix timestamp $displaytime=date("F j, Y, g:i a"); //we now strip HTML injections $subject=strip_tags($subject); $name=strip_tags($name); $yourpost=strip_tags($yourpost); $insertpost="INSERT INTO forumtutorial_posts(author,title,post,showtime,realtime,lastposter,forumid) values('$name','$subject','$yourpost','$displaytime','$thedate','$name','$forumid')"; mysql_query($insertpost) or die("Could not insert post"); //insert post print "Message posted, go back to <A href='index.php?forumid=$forumid'>Forum</a>."; } } else { print "<form action='post.php' method='post'>"; print "Subject:<br>"; print "<input type='text' name='subject' size='20'><br>"; print "Your message:<br>"; print "<textarea name='yourpost' rows='5' cols='40'></textarea><br>"; print "<input type='submit' name='submit' value='submit'></form>"; } print "</td></tr></table>"; include "footer.php"; ?>
  7. <html> <head> <title>Airboard - Beta</title> <?php include ("menu.php"); include "connect.php"; //mysql db connection here $_GET ['forumid']; print "<link rel='stylesheet' href='style.css' type='text/css'>"; print "<A href='post.php'>New Topic</a>"; print "<table class='maintable'>"; print "<tr class='headline'><td width=50%>Topic</td><td width=20%>Topic Starter</td><td>Replies</td><td>Last replied time</td></tr>"; $getthreads="SELECT * from forumtutorial_posts where parentid='0' and forumid= ['forumid'] order by realtime DESC"; $getthreads2=mysql_query($getthreads) or die("Could not get threads"); while($getthreads3=mysql_fetch_array($getthreads2)) { $getthreads3[title]=strip_tags($getthreads3[title]); $getthreads3[author]=strip_tags($getthreads3[author]); print "<tr class='mainrow'><td><A href='message.php?id=$getthreads3[postid]'>$getthreads3[title][/url]</td><td>$getthreads3[author]</td><td>$getthreads3[numreplies]</td><td>$getthreads3[showtime] Last post by $getthreads3[lastposter]</td></tr>"; } print "</table>"; ?> i tried replacing your bit and it didnt work. ill send you the lik to where im trying to get to work http://www.airservers.com/airboard/veiw_forum.php?forumid=1
  8. If teyre all in the same database you could edit the files to all use the same table to retreive the user information, that was users only have to regester once
  9. Hi, im trying to make a forum and in my veiw_forum.php its supposed to only show the posts with the forumid the same as the forum id in the link forum the page before (www.domain.com/view_forum.php?forumid=1) , this is my code so far but it isnt working, can someone tell me whats going wong? <html> <head> <title>Airboard - Beta</title> <?php include ("menu.php"); include "connect.php"; //mysql db connection here $_GET ['forumid']; print "<link rel='stylesheet' href='style.css' type='text/css'>"; print "<A href='post.php'>New Topic</a><br>"; print "<table class='maintable'>"; print "<tr class='headline'><td width=50%>Topic</td><td width=20%>Topic Starter</td><td>Replies</td><td>Last replied time</td></tr>"; $getthreads="SELECT * from forumtutorial_posts where parentid='0' and forumid= ['forumid'] order by realtime DESC"; $getthreads2=mysql_query($getthreads) or die("Could not get threads"); while($getthreads3=mysql_fetch_array($getthreads2)) { $getthreads3[title]=strip_tags($getthreads3[title]); $getthreads3[author]=strip_tags($getthreads3[author]); print "<tr class='mainrow'><td><A href='message.php?id=$getthreads3[postid]'>$getthreads3[title]</a></td><td>$getthreads3[author]</td><td>$getthreads3[numreplies]</td><td>$getthreads3[showtime]<br>Last post by <b>$getthreads3[lastposter]</b></td></tr>"; } print "</table>"; ?>
  10. h i am making a forum and on he index its supposed to have a list of forums, i have that but when you clock a forum its supposed to link to a sub forum, the sub forum should show posts in a table forumtutorial_posts that have forumid to the same value as the forum is in. heres my code. index.php <HTML> <body> <TABLE style=BORDER-COLLAPSE: collapse borderColor=#77a7ad cellSpacing=1 cellPadding=1 width=100% bgColor=#ffffff border=1> <tr> <th width=100 height=25 nowrap=nowrap>Forum name</th> </tr> <?php include "connect.php"; //mysql db connection here $result = mysql_query("SELECT forumname FROM forums"); if(mysql_num_rows($result)!= "") { $stt=0; while ($row = mysql_fetch_array($result)) { $stt++; print " <tr> <td align=center><a href=/veiw_forum.php?forumid=$forumid><span>".$row['forumname']."</span></td></a> </tr> "; } } mysql_free_result($result); ?> </table> </body> </HTML> veiw_forum.php <?php include("include/session.php"); include "header.php"; include ("menu.php"); include "connect.php"; //mysql db connection here print "<link rel='stylesheet' href='style.css' type='text/css'>"; print "<A href='post.php'>New Topic</a><br>"; print "<table class='maintable'>"; print "<tr class='headline'><td width=50%>Topic</td><td width=20%>Topic Starter</td><td>Replies</td><td>Last replied time</td></tr>"; print "</table>"; include("include/view_active.php"); include "footer.php"; ?>
  11. Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home2/airserve/public_html/airboard/header.php:2) in /home2/airserve/public_html/airboard/include/session.php on line 21 on my index page and i havent edited the sessions.php before i got the error, this is on my index page and this is my index.php code <?php include "header.php"; include ("menu.php"); include "connect.php"; //mysql db connection here include("include/session.php"); print "<link rel='stylesheet' href='style.css' type='text/css'>"; if($session->logged_in) { echo "Welcome <b>$session->username</b>, you are logged in. <br><br>" ."[<a href=\"userinfo.php?user=$session->username\">My Account</a>] " ."[<a href=\"useredit.php\">Edit Account</a>] "; if($session->isAdmin()) { echo "[<a href=\"admin/admin.php\">Admin Center</a>] "; } echo "[<a href=\"process.php\">Logout</a>]"; } else { echo "Welcome <b>Guest</b>, you are not logged in. <a href='main.php'>Login</a><br><br>"; } print "<A href='post.php'>New Topic</a><br>"; print "<table class='maintable'>"; print "<tr class='headline'><td width=50%>Topic</td><td width=20%>Topic Starter</td><td>Replies</td><td>Last replied time</td></tr>"; $getthreads="SELECT * from forumtutorial_posts where parentid='0' order by realtime DESC"; $getthreads2=mysql_query($getthreads) or die("Could not get threads"); while($getthreads3=mysql_fetch_array($getthreads2)) { $getthreads3[title]=strip_tags($getthreads3[title]); $getthreads3[author]=strip_tags($getthreads3[author]); print "<tr class='mainrow'><td><A href='message.php?id=$getthreads3[postid]'>$getthreads3[title]</a></td><td>$getthreads3[author]</td><td>$getthreads3[numreplies]</td><td>$getthreads3[showtime]<br>Last post by <b>$getthreads3[lastposter]</b></td></tr>"; } print "</table>"; include("include/view_active.php"); include "footer.php"; ?>
×
×
  • 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.