Note that there are some explanatory texts on larger screens.

plurals
  1. POmysql_real_escape_string in PHP 5.2 and 5.3?
    primarykey
    data
    text
    <p>I made a simple content editor which utilizes CKEditor. As of currently, it works fine on my local web server but when I upload it to my remote server, it goes out of whack.</p> <p>Below is a sample output from my local server.</p> <pre><code>&lt;img alt="" src="usrfiles/default_placeholder.png" style="width: 150px; height: 150px; " /&gt; </code></pre> <p>And below is the output that my remote server returns.</p> <pre><code>&amp;lt;img alt=&amp;quot;\&amp;amp;quot;\&amp;amp;quot;&amp;quot; data-cke-saved-src=&amp;quot;\&amp;quot; src=&amp;quot;\&amp;amp;quot;usrfiles/default_placeholder.png\&amp;amp;quot;&amp;quot; style=&amp;quot;\&amp;amp;quot;width:&amp;quot; 150px;=&amp;quot;&amp;quot; height:=&amp;quot;&amp;quot; \&amp;quot;=&amp;quot;&amp;quot;&amp;gt; </code></pre> <p>I didn't do any modifications to the code I use locally and remotely. Aside from of course, changing the database pointers (server, db name, username, etc). My only suspect right now is the <strong>mysql_real_escape_string()</strong> which I use upon submission of the text.</p> <p>My local server uses PHP version 5.3.6 and my remote server uses PHP version 5.2.13. Is there a difference with the <strong>mysql_real_escape_string()</strong> behavior on these two versions?</p> <p><strong>EDIT</strong> In reply to CodeCaster, "Please provide more context to where this "output" comes from. How is it stored in the database, how do you store and retreive it, how do you view it. It most probably has nothing to do with mysql_real_escape_string() as it has with magic quotes and htmlentities."</p> <p>The output comes from an SQL query. It is stored in the database as TEXT data type. It is stored and retrieved both via PHP SQL queries. I use mysql_real_escape_string() while I INSERT or UPDATE the data. On my local server, I can INSERT it with a query enclosed inside mysql_real_escape_string() and retrieve it without any alterations to the stored data and it outputs the data as HTML code just fine. On the remote server, this system breaks.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload