shelyshely Posted October 2, 2008 Share Posted October 2, 2008 I have a very simple php forum I created through a class I took with Sessions.edu about a year ago. It never really worked right then but I'm trying to use it now on our Family Reunion page. My main issue is when you reply to someones post it shows as if they posted the response even though someone else is logged in. My url is http://www.cavazosfamilyreunion.com/forum.htm. I will gladly submit my code to anyone that can help me. Link to comment https://forums.phpfreaks.com/topic/126744-solved-simple-forum-code-not-working/ Share on other sites More sharing options...
trq Posted October 2, 2008 Share Posted October 2, 2008 We need to see code. Link to comment https://forums.phpfreaks.com/topic/126744-solved-simple-forum-code-not-working/#findComment-655570 Share on other sites More sharing options...
shelyshely Posted October 2, 2008 Author Share Posted October 2, 2008 I don't know which page to post, I have: show_topic reply_in_topic add_topic show_forum Here is my code for reply_in_topic: <?php session_start(); if (!isset($_SESSION[id])) { header("Location: login.php"); exit; } if ($_POST[op] != "ds") { if ((!isset($_GET[f])) || (!isset($_GET[t]))) { header("Location: forums.php"); exit; } $display_block = " <form method=POST action=\"$_SERVER[php_SELF]\"> <p><strong>Post Text:</strong><br> <textarea name=\"post_text\" rows=8 cols=40 wrap=virtual></textarea> <input type=\"hidden\" name=\"forum_id\" value=\"$_GET[f]\"> <input type=\"hidden\" name=\"topic_id\" value=\"$_GET[t]\"> <input type=\"hidden\" name=\"op\" value=\"ds\"> <p><input type=submit name=\"submit\" value=\"Submit Form\"></p> </form>"; } else { foreach ($_POST as $form_var) { if (trim($form_var) == "") { header("Location: reply_to_post.php?t=$_GET[t]"); exit; } } $conn = mysql_connect("xxxxxxxxx", "xxxxx", "xxxxxxx") or die(mysql_error()); mysql_select_db("xxxxx",$conn) or die(mysql_error()); $add_post = "INSERT INTO forum_posts VALUES ('', '$_POST[topic_id]', '$_POST[forum_id]', '$_POST[post_text]', '$_SESSION[id]', now())"; mysql_query($add_post, $conn) or die(mysql_error()); header("Location: show_topic.php?topic_id=$topic_id"); exit; } ?> Link to comment https://forums.phpfreaks.com/topic/126744-solved-simple-forum-code-not-working/#findComment-655610 Share on other sites More sharing options...
shelyshely Posted October 3, 2008 Author Share Posted October 3, 2008 I've decided to go another way and use Mercury Board for my forum. So that link goes somewhere else now. Thanks anyway. Link to comment https://forums.phpfreaks.com/topic/126744-solved-simple-forum-code-not-working/#findComment-656371 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.