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. Link to comment https://forums.phpfreaks.com/topic/36799-using-rte-all-s-turn-into-why/ 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() Link to comment https://forums.phpfreaks.com/topic/36799-using-rte-all-s-turn-into-why/#findComment-175563 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. Link to comment https://forums.phpfreaks.com/topic/36799-using-rte-all-s-turn-into-why/#findComment-175571 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.