Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8073579
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T14:22:37+00:00 2026-06-05T14:22:37+00:00

I am trying to pass javascript code from 1 page of my website to

  • 0

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>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T14:22:40+00:00Added an answer on June 5, 2026 at 2:22 pm

    What if you str_replace('<', '&lt;', $formelement) ?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to pass a value from php to javascript. I understand one
I have the following javascript class which I am trying to pass to an
Trying to pass in a user supplied string which has a path to the
I am trying to pass my variables from my main page to external JS
I am trying to dynamically pass a double array from C# to some JavaScript
I am trying to use a textarea form entry which I have some javascript
Im trying to pass some values into a text box from a child page
I am trying to pass an arbitrary amount of arrays from my javascript to
I'd like to execute JavaScript code from within a C# assembly and have the
I'm trying to figure out how I can pass data from page-list.php to page.php

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.