I have only 1 problim, when i try to add something to the databace it wont add it to it.
Here is the source code for the form
<?php
include ('functions.php');
echo "<form name=\"form1\" method=\"post\" action=\"handle_news.php\">
<strong><font size=\"3\">Post news...<br /></font></strong>
<br />
Username:
<br />
<input name=\"user\" type=\"text\" id=\"user\" size=\"30\"><br />
News Title:
<br />
<input name=\"title\" type=\"text\" id=\"title\" size=\"40\"><br />
Mood:
<br />
<input name=\"title\" type=\"text\" id=\"mood\" size=\"40\"><br />
News:
<br />
<textarea name=\"news\" cols=\"60\" rows=\"25\" id=\"news\"></textarea>
<br />
<input type=\"submit\" name=\"Submit\" value=\"Post\">
</form>";
?>
And here is the handleing form
<?php
include ('functions.php');
$user = $_POST['user'];
$title = $_POST['title'];
$mood = $_POST['mood'];
$date = date('Y-m-d');
//change the bbcode into html using perl compatible regular expressions
$news = $_POST['news'];
$bbcode = array(
"/\[link\](.*?)\[\/link\]/",
"/\[url\](.*?)\[\/url\]/",
"/\[img\](.*?)\[\/img\]/",
"/\[b\](.*?)\[\/b\]/",
"/\[u\](.*?)\[\/u\]/",
"/\[i\](.*?)\[\/i\]/"
);
$html = array(
"<a href=\"\\1\">\\1</a>",
"<a href=\"\\1\">\\1</a>",
"<img src=\"\\1\">",
"<b>\\1</b>",
"<u>\\1</u>",
"<i>\\1</i>"
);
$news1 = preg_replace($bbcode,$html, $news);
mysql_query("INSERT INTO news(user,title,news,date,mood) VALUES('$user','$title','$news1','$date','$mood',now())");
?>
And i get no mysql errors in the functions page at all
Cansomeone please help me,
+ Sh|fty
