alisemail Posted February 2, 2007 Share Posted February 2, 2007 So I've installed an RTE thats javascript based and utilize it to styelize text. When submitted the following code executes $content = $_POST['rte1']; $name = $_POST['name']; $year = $_POST['year']; mysql_query("INSERT INTO $campaign_table (name, current, year, overview) VALUES ('$name', '$current', '$year', '$content')"); mysql_close($link); $confirm = "<h2>$name for $year has been added!</h2>\n"; $confirm .= "<p>The Details is as follows</p>\n"; if($current == 1) { $confirm .= "<p>This campaign is marked as the current campaign</p>\n"; } $confirm .= "<p>" . $content . "</p>\n"; In the MySQL Database the following is the value: <span style="font-weight: bold;">ddsdsd </span> When I echo it out in the page with <? if(isset($confirm)) { print $confirm; } ?> (I've tried both print and echo both do the same) The source code shows <p><span style=\"font-weight: bold;\">ddsdsd </span></p> Any ideas as to why these \'s are added? Thanks in advance. Quote Link to comment Share on other sites More sharing options...
Jessica Posted February 2, 2007 Share Posted February 2, 2007 it's called Magic Quotes. You can turn it off in php.ini or use strip_slashes() Quote Link to comment Share on other sites More sharing options...
Snooble Posted February 2, 2007 Share Posted February 2, 2007 They are added to stop you ending your current function etc. echo "i am an echo if i wanted to type a quote or select information inside this speech i could use 'apostrophes' or /"magic quotes/" It basically tells the php to ignore the speech marks coming up. Quote Link to comment 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.