Jump to content

[SOLVED] strange post problem


quickstopman

Recommended Posts

hey guys im currently working on a page that posts a topic in my data base

but for some odd reason instead of it posting the info i the database it just posts the info and the screen and doesn't put it in the database

here is the code

<?
ob_start();
session_start();
include("ZZcode.h");
include("header.php");
include("config.php");
if(isset($_SESSION['email'])) {


if($_POST['submit']) {


$errors = array();
$topic = $_POST['topic'];
$content = ZZcode($_POST['content']);
if (empty($topic)) {
echo '
<script type="javascript">
alert("Please Enter a Topic!");
</script>
';
return false;
} 
if (empty($content)) {
echo '
<script type="javascript">
alert("Please Enter Content!");
</script>';
return false;
}
$query = "INSERT INTO post (topic, content, time_posted , reply_to, posted_by) VALUES ('$topic', '$content', '', '$topic', '{$_SESSION['username']}')";
$result = @mysql_query($query) or die(mysql_error());
echo "Thanks for posting your topic!<br>
you can view your topic <a href='posts.php'>here</a><br>";
} else {
echo '
<form action="'. $_SERVER['PHP_SELF'] .'" method="POST">
Topic: <input name="topic" type="text"><br><br>
Post Content:<br>
<textarea cols="32" rows="10px" name="content"></textarea><br>
<input type="submit" name="submit" value="Post Topic">
</form>
';
}
} else {
echo "You must be logged in to post a forum topic";
}
?>

any ideas?

thanks

Link to comment
https://forums.phpfreaks.com/topic/58640-solved-strange-post-problem/
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.