Problem with $_POST
<p>This wont work. All the fields are correct etc and I have a db connection.</p>

<p>To the problem</p>

<p>I use this script to insert a post into the db:</p>

<pre><code>&lt;?php

if (isset($_POST['msg'])) {

$title = mysql_real_escape_string($_POST['title']);
$msg = mysql_real_escape_string($_POST['msg']);

// kolla efter tomma fält
if (empty($title) || empty($msg)) {
$reg_error[] = 1;
}

if (!isset($reg_error)) {
mysql_query("INSERT INTO messages (title, message, date, user_id)
             VALUES('$title', '$msg', '".time()."', '2')");

header('location: /');

exit;

}


}
?&gt;
</code></pre>

<p><b>The Form:</b></p>

<pre><code>&lt;form action="post_msg.php" method="post"&gt;

&lt;b&gt;Title:&lt;/b&gt;
&lt;input type="text" name="title" size="40" /&gt;


&lt;b&gt;Message:&lt;/b&gt;
&lt;textarea rows="15" cols="75" name="msg"&gt;&lt;/textarea&gt;


&lt;input type="submit" value="Post Message" /&gt;
&lt;/form&gt;
</code></pre>

<p></p>

<p>Worked fine the other day. Not today. No errors. The "post stuff" shows up in the url. I thought it only did when using $_GET which i dont.
<code>http://localhost/post_msg.php?title=fdsg&amp;msg=sdfg</code></p>

<p>i dont get any errors the page just reloads</p>

<p>messages db</p>

<pre><code>CREATE TABLE IF NOT EXISTS `messages` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`title` varchar(140) COLLATE utf8_unicode_ci DEFAULT NULL,
`message` text COLLATE utf8_unicode_ci
`date` int(10) unsigned NOT NULL,
`user_id` int(10) unsigned NOT NULL,
 PRIMARY KEY (`id`),
 FULLTEXT KEY `title` (`title`,`message`)
</code></pre>
