Note that there are some explanatory texts on larger screens.

plurals
  1. POSaving javascript code inside database
    primarykey
    data
    text
    <p>I've very annoying problem with hosting of well known company however</p> <p>I've website and at its back-end there is form has <code>textarea</code> field where it should be for <code>google adsense code</code> when i submit it does not respond at all and keep loading</p> <p>but when i type anything else then <code>adsense ads code</code> it accepted so i noticed it not allowing for html </p> <p><strong>Form code</strong></p> <pre><code>&lt;form method=post action="1.php" name="adsense" id="adsense"&gt; The Code : &lt;textarea id="ad" name="ad"&gt;Put your code here&lt;/textarea&gt; &lt;input type="submit" name="submit" value="Save"&gt; &lt;/form&gt; </code></pre> <p><strong>1.php Code</strong></p> <pre><code>&lt;?PHP include "header.php"; // connect to db if(isset($_POST[submit])){ $qma = "update webads set ad = '$_POST[ad]'"; $rma = mysql_query($qma) or die(mysql_error()); echo 'Thanks'; } ?&gt; </code></pre> <p><strong>The problem</strong> when i put <code>adsense ads code</code> it not respond and not save it in database but if i put any text it save it normally</p> <p>so i've been thinking to <code>addslashes()</code> but it also didn't worked after i made such changes</p> <pre><code>ad1 = 'addslashes($_POST[ad1])' </code></pre> <p>here is example of unaccepted <code>google adsense code</code></p> <pre><code>&lt;script type="text/javascript"&gt; google_ad_client = "pub-0000000000000000"; google_ad_width = 250; google_ad_height = 250; google_ad_format = "250x250_as"; google_ad_type = "text"; google_ad_channel = "0000000000"; google_color_border = "FFFCE1"; google_color_bg = "FFFCE1"; google_color_link = "FFFCE1"; google_color_text = "FFFCE1"; google_color_url = "FFFCE1"; &lt;/script&gt; &lt;script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;&lt;/script&gt; </code></pre> <p>One last note</p> <p>the database field structure is <code>text NOT NULL</code></p> <pre><code>CREATE TABLE `webads` ( `id` varchar(50) NOT NULL default '', `ad` text NOT NULL PRIMARY KEY (`id`))"; </code></pre> <p>so any idea how to save it ! but it must be easy to recall it back without being altered</p> <p>i don't know if it stupid or not but if i didn't got any answer how to do it, been thinking to <code>base_64 encoder</code> before save it then when i call it back will <code>base_64 decode</code> it but this sound last hope i can do</p> <p>Thanks a lot</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.
    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