I am trying to pass javascript code from 1 page of my website to another page (on submit of a form)
The user enters an adsense code which is a javascript code like this :
<script type="text/javascript"><!--
google_ad_client = "nnnnddddnnnd";
/* abcdabcd */
google_ad_slot = "61748777731443";
google_ad_width = 123;
google_ad_height = 234;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
I want to pass this javascript from page 1 as a normal from field using get or post to page 2. When I use GET the browser shows permission denied and when I use POST there is no output of the javascript on the page 2
How can I do this?
Additional info:
the user enters the code in a text box on page 1 and presses submit then page1 is directed to page 2 where I want to use this JS on page 2 but I am unable to pass it even with POST
CODE
<form id="tryform" class="a-center" action="page2.php" method="post" onSubmit="return checkurl();" >
<input name="ref" type="hidden" value="" />
<div >
Enter the URL of the web page <br/>
<span class="input-box full-width" style="float:center">
<input id="url" name="url" type="text" value="Paste your website URL here"
onblur="if(this.value==''){this.value='Paste your website URL here'}"
onfocus="if(this.value=='Paste your website URL here'){this.value=''}"/>
</span>
</div>
<div >
Place your code here:
<br/>
<textarea id="adcode" name="adcode" cols="60" rows="8"></textarea>
</div>
<div>
<button type="submit" class="button" name="B1" value="B1" >b1</button>
</div>
</form>
What if you
str_replace('<', '<', $formelement)?