Creating a mysql php link for the user to create a post in the forum -
i'm trying create forum, following tutorial https://www.youtube.com/watch?v=kebwxi1bw88. i've followed succesfully untill point reason link user go , create forum post within topic not working. can see problems code or spot reason why isnt working. cant see wrong code , have followed tutorial letter.
the link within first if statement.
the link should appear on page , file create_topic.php hasnt been created yet.
<?php session_start();?> <!doctype html> <html> <head> <meta charset="utf-8"> <title>forum</title> <link href="styles.css" rel="stylesheet" type="text/css"> <script>var __adobewebfontsappname__="dreamweaver"</script> <script src="http://use.edgefonts.net/source-sans-pro:n6:default.js" type="text/javascript"></script> </head> <body> <div id="wrapper"> <header id="top"> <h1>itsize</h1> <nav id="mainnav"> <ul> <li><a href="index.php">home</a></li> <li><a href="fourth page.html">register</a></li> <li><a href="second page.html">revise</a></li> <li><a href="forum.php">forum</a></li> </ul> </nav> </header> <article id="main"> <br> <br> <?php include_once("dbconnect.php"); $cid= $_get['cid']; if (isset($_session['uid'])){ $logged= " | <a href='create_topic.php?cid=".$cid."'>click here create topic</a>"; }else{ $logged = " | please log in create topics in forum"; } $sql = "select id categories id='".$cid."' limit 1"; $res = mysql_query($sql) or die(mysql_error()); if (mysql_num_rows($res) ==1){ $sql2 = "select * topics category_id='".$cid."' order topic_reply_date desc"; $res2 = mysql_query($sql2) or die(mysql_error()); if (mysql_num_rows($res2)>0){ $topics .= "<table width='100%' style='border-collapse: collapse;'>"; $topics .= "<tr><td colspan='3'<a href='forum.php'>return forum</a>".$logged."</td></tr>"; $topics .= "<tr style='background-colour: #dddddd;'><td>topic title</td><td width='65' align='center'>replies</td><td width='65' align='center'>views</td</tr>"; while ($row = mysql_fetch_assoc($res2)){ $tid = $row['id']; $title = $row['topic_title']; $views = $row['topic_views']; $date = $row['topic_date']; $creator =$row['topic_creator']; $topics .= "<tr><td><a href='view_topic.php?cid=".$cid."&tid=".$tid.">".$title."</a><spa class='post_info'>posted by:".$creator." on ".$date."</span></td><td align='center'>0</td><td align='center'>".$views."</td></tr>"; $topics .="<tr><td colspan='3'></td></tr>"; } $topics .="</table>"; }else{ echo"<p> there no topics in category yet</p><br>"; echo "<a href='forum.php'>return forum page</a><br><br>"; } } else{ echo"<p> trying view category not exist</p><br>"; echo "<a href='forum.php'>return forum page</a><br><br>"; } ?> </article> <aside id="sidebar"> </aside> <footer><a href="third page.html">my account</a> </footer> </div> </body> </html>
Comments
Post a Comment