Jump to content

Help with php forum


Infectious

Recommended Posts

Hello everybody.

I successfully got a forum up and running a bit ago, but there is only 1 problem.

when 1 user posts, it duplicates that post from every other user registered.

heres is the link you can make an account and test it yourself.

http://www.gameblaze.net/forum

 

 

Please if you can help I would be oh so greatful.

Sincerely,

Infectious

Link to comment
https://forums.phpfreaks.com/topic/282088-help-with-php-forum/
Share on other sites

here is the reply.php code

<?php

include 'connect.php';
include 'header.php';

if($_SERVER['REQUEST_METHOD'] != 'POST')
{
	
	echo 'This file cannot be called directly.';
}
else
{
	
	if(!$_SESSION['signed_in'])
	{
		echo 'You must be signed in to post a reply.';
	}
	else
	{
		
		$sql = "INSERT INTO 
					posts(post_content,
						  post_date,
						  post_topic,
						  post_by) 
				VALUES ('" . $_POST['reply-content'] . "',
						NOW(),
						" . mysql_real_escape_string($_GET['id']) . ",
						" . $_SESSION['user_id'] . ")";
						
		$result = mysql_query($sql);
						
		if(!$result)
		{
			echo 'Your reply has not been saved, please try again later.';
		}
		else
		{
			echo 'Your reply has been saved, check out <a href="topic.php?id=' . htmlentities($_GET['id']) . '">the topic</a>.';
		}
	}
}

include 'footer.php';
?>
Link to comment
https://forums.phpfreaks.com/topic/282088-help-with-php-forum/#findComment-1449283
Share on other sites

Archived

This topic is now archived and is closed to further replies.

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