PHP Code:
<?php
// Includes
include("dbconnect.php");
include("config.php");
if($_POST['Submit']) {
?>
You have chosen to post a reply to this topic. Fill in your name , then the message you want to post. Then press submit. <br>
<br>
<form name="form1" method="post" action="postmsg.php">
<table width="712" border="0">
<tr>
<th width="139" scope="col">Poster:</th>
<th width="62" scope="col"> </th>
<th width="497" scope="col"><input name="poster" type="text" size="30"></th>
</tr>
</table>
<table width="884" border="0">
<tr>
<th scope="col"> </th>
<th scope="col">Message:</th>
<th scope="col"> </th>
</tr>
</table>
<table width="884" height="310" border="0">
<tr>
<th width="135" scope="col"> </th>
<th width="607" scope="col"><textarea name="message" cols="99" rows="17"></textarea></th>
<th width="128" scope="col"> </th>
</tr>
</table>
<table width="884" border="0">
<input name="id" type="hidden" value="<?php echo $_GET['id']; ?>" />
<tr>
<th scope="col"> </th>
<th scope="col"><input type="submit" name="Submit" value="Submit"></th>
<th scope="col"> </th>
</tr>
</table>
<p> </p>
<p> </p>
</form>
<?php
}
elseif($_POST['Submit']) {
/*
If you are using x10hosting as your host, magic_quotes_gpc are turned ON! That means that all single/double quotes, NULL's, and slashes are escaped automatically in GET/POST/COOKIE global variables. If you add slashes again, all quotes/slashes/etc will have [B]2[/B] slashes before them, which can be a pain. I know for a fact that x10hosting's magic_quotes_gpc is "turned on", as I have checked myself a few times now.
*/
$poster = $_POST['poster'];
$message = $_POST['message'];
$id = $_POST['id'];
// $poster = addslashes($_POST['poster']);
// $message = addslashes($_POST['message']);
// $id = addslashes($_POST['id']);
// Insert the row into the database table
mysql_query("INSERT INTO `messages` (`topic_ID`, `bericht_poster`, `bericht`) VALUES ('$id', '$poster', '$message')") or die(mysql_error()); // Effective MySQL error reporting function. -> [url]http://us3.php.net/mysql_error[/url]
// Echo success message
echo 'Your message has been placed. Please click <a href="http://'. $_SERVER['HTTP_HOST'] . $forumdir .'/functions/showtopic.php?id='. $_POST['id'] .'"> here</a> and go back to the page you came from.';
}
?>
That should work.. If it doesn't, post back here with the error and I'll try to help you out some more.
:sleep2: