ambo Posted February 26, 2009 Share Posted February 26, 2009 Parse error: parse error, unexpected ';', expecting ')' in /home/content/d/e/c/decuralogin/html/Process/add_topic.php on line 43 Line 43 Being the last one shown Any ideas $patterns = array( "/\[url\](.*?)\[\/url\]/", "/\[img\](.*?)\[\/img\]/", "/\[b\](.*?)\[\/B\]/", "/\[b\](.*?)\[\/b\]/", "/\[u\](.*?)\[\/U\]/", "/\[u\](.*?)\[\/u\]/", "/\[i\](.*?)\[\/I\]/", "/\[i\](.*?)\[\/i\]/", "/\[quote\](.*?)\[\/quote\]/", "/\[quote\](.*?)\[\/QUOTE\]/", "/\[code\](.*?)\[\/code\]/", "/\[code\](.*?)\[\/CODE\]/", "/\[s\](.*?)\[\/s\]/", "/\[s\](.*?)\[\/S\]/", "/\[url=(.*?)\](.*?)\[\/url\]/", "/\[color=(.*?)\](.*?)\[\/color\]/", "/\[size=(.*?)\](.*?)\[\/size\]/", "/\[marquee\](.*?)\[\/marquee\]/", "/\[br\]/", "/\:\)/", "/\:\(/", "/\:O/", "/\:P/", "/\:\|/", "/\:D/", "/\:!!!\:/"); Quote Link to comment https://forums.phpfreaks.com/topic/146976-solved-error-expecting-but-its-there/ Share on other sites More sharing options...
trq Posted February 26, 2009 Share Posted February 26, 2009 There aren't any syntax errors in that piece of code, can we see a little before and after? Quote Link to comment https://forums.phpfreaks.com/topic/146976-solved-error-expecting-but-its-there/#findComment-771604 Share on other sites More sharing options...
ambo Posted February 26, 2009 Author Share Posted February 26, 2009 Its To process BBCODE <?php include("dbconnect.php"); $tbl_name="forum_question"; // Table name // get data that sent from form $topic=$_POST['topic']; $name=$_POST['name']; $message = $_POST['mytxtarea']; $message = str_replace("<", "", $message); $message = str_replace(">", "", $message); $patterns = array( $patterns = array( "/\[url\](.*?)\[\/url\]/", "/\[img\](.*?)\[\/img\]/", "/\[b\](.*?)\[\/B\]/", "/\[b\](.*?)\[\/b\]/", "/\[u\](.*?)\[\/U\]/", "/\[u\](.*?)\[\/u\]/", "/\[i\](.*?)\[\/I\]/", "/\[i\](.*?)\[\/i\]/", "/\[quote\](.*?)\[\/quote\]/", "/\[quote\](.*?)\[\/QUOTE\]/", "/\[code\](.*?)\[\/code\]/", "/\[code\](.*?)\[\/CODE\]/", "/\[s\](.*?)\[\/s\]/", "/\[s\](.*?)\[\/S\]/", "/\[url=(.*?)\](.*?)\[\/url\]/", "/\[color=(.*?)\](.*?)\[\/color\]/", "/\[size=(.*?)\](.*?)\[\/size\]/", "/\[marquee\](.*?)\[\/marquee\]/", "/\[br\]/", //emoticons "/\:\)/", "/\:\(/", "/\:O/", "/\:P/", "/\:\|/", "/\:D/", "/\:!!!\:/"); $replacements = array( //bbcode "<a href=\"\\1\">\\1</a>", "<img border=0 src='\\1'>", "<b>\\1</b>", "<b>\\1</b>", "<u>\\1</u>", "<u>\\1</u>", "<i>\\1</i>", "<i>\\1</i>", "<div><b>Quote:</b> <i>\\1</i></div>", "<div><b>Quote:</b> \\1</div>", "<b>Code:</b><div style='line-height: 12px; width: 99%; white-space: nowrap; overflow: auto; max-height: 25em;'>\\1</div>", "<b>Code:</b><div style='line-height: 12px; width: 99%; white-space: nowrap; overflow: auto; max-height: 25em;'>\\1</div>", "<s>\\1</s>", "<s>\\1</s>", "<a href=\"\\1\" target=\"_blank\">\\2</a>", "<font color=\"\\1\">\\2</font>", "<font size=\"\\1\">\\2</font>", "<marquee>\\1</marquee>", "<br />", //emoticons "<img src=\"bbeditor/images/smilies/yellow/smile.gif\" border=\"0\">", "<img src=\"bbeditor/images/smilies/yellow/sad.gif\" border=\"0\">", "<img src=\"bbeditor/images/smilies/yellow/angry.gif\" border=\"0\">", "<img src=\"bbeditor/images/smilies/yellow/tongue.gif\" border=\"0\">", "<img src=\"bbeditor/images/smilies/yellow/dry.gif\" border=\"0\">", "<img src=\"bbeditor/images/smilies/yellow/woot.gif\" border=\"0\">", "<img src=\"bbeditor/images/smilies/yellow/exc.gif\" border=\"0\">"); $post = preg_replace($patterns,$replacements, $message); $datetime=date("d/m/y h:i:s"); //create date time $sql="INSERT INTO $tbl_name(topic, detail, name, datetime)VALUES('$topic', '$post', '$name', '$datetime')"; $result=mysql_query($sql); if($result){ echo "Successful<BR>"; echo "<a href=../forum.php>View your topic</a>"; } else { echo "ERROR"; } mysql_close(); ?> Quote Link to comment https://forums.phpfreaks.com/topic/146976-solved-error-expecting-but-its-there/#findComment-771605 Share on other sites More sharing options...
trq Posted February 26, 2009 Share Posted February 26, 2009 You have two lines of.... $patterns = array( Quote Link to comment https://forums.phpfreaks.com/topic/146976-solved-error-expecting-but-its-there/#findComment-771612 Share on other sites More sharing options...
priti Posted February 26, 2009 Share Posted February 26, 2009 Repetition $patterns = array( {line 11-12} $patterns = array( {line 12-13 } remove one :-) . then it should work. There is no problem in array formation. Quote Link to comment https://forums.phpfreaks.com/topic/146976-solved-error-expecting-but-its-there/#findComment-771613 Share on other sites More sharing options...
ambo Posted February 26, 2009 Author Share Posted February 26, 2009 God Thank you ive been looking at this screen all night working Feel Stupid for missing it Quote Link to comment https://forums.phpfreaks.com/topic/146976-solved-error-expecting-but-its-there/#findComment-771614 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.