Welcome to WebmasterWorld Guest from

Forum Moderators: incrediBILL

Message Too Old, No Replies

Form Script conflict

Adsense code conflicting with Form Script



1:53 am on Dec 7, 2007 (gmt 0)

10+ Year Member

Hi -
The problem is that the Adsense JavaScript corrupts the input fields of a configuration form I use for un-geeks to paste in stuff to personalize their blogs.

The Data path is:
Configure_Blog.php Form reads from config_saved.php into input fields as VALUE=
User edits displayed data
Configure_Blog.php posts data to config.php as $_SESSION variables
config.php writes data back to config_saved.php

POST escapes the "s in the Adsense code and it all work perfectly up to the point where it requires to read the Adsense code back into the next form session as "Existing Code" and it reads it back in UN-escaped and corrupts the form.

I use this code in the form

<td>Menu Ad Code</td>
<td><textarea cols="24" rows="2" onFocus="this.blur()" id="mac" name="mac" ><?php echo ($_SESSION["mac"]);?></textarea></td>
<td><textarea cols="17" rows="2" id="mac2" name="mac2" onfocus="value='<?php echo ($_SESSION["mac"]);?>'" onblur=" mac.value=value;"></textarea></td>
<td>Default Value = None</td>

I think I need to be able to somehow ESCAPE the "s in the retrieved variable before INPUT-ing it.

The form works by displaying the saved data in the (un-editable)LH input field, and uses onblur to update it with user input data from the RH field.


Featured Threads

Hot Threads This Week

Hot Threads This Month