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 9246277
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T09:27:18+00:00 2026-06-18T09:27:18+00:00

I have a couple pieces of code that should grab a form from another

  • 0

I have a couple pieces of code that should grab a form from another website. The php in the header sanitizes the GET string in the URL.
Basically I have a page: order.html, which works if I paste the entire javascript function in it like so:

<?php  if (isset($_GET['url'])) {
            echo file_get_contents("http://".sanitizeString($_GET['url']));
        }
function sanitizeString($var) {
    $var = strip_tags($var);
    $var = htmlentities($var);
    return stripslashes($var);
} ?>


<html>
<body>
<p>html text still displays</p>
<script>
document.write("<div id='info'></div>");
nocache = "&nocache=" + Math.random() * 1000000
request = new ajaxRequest()
request.open("GET", "<?php echo basename($_SERVER['SCRIPT_FILENAME']); ?>?url=platform.leedhub.com/merchants/form.php?merchant_id=<?php echo $_GET['merchantid']; ?>&margin=<?php echo $_GET['affiliateid'] ?>&padding=<?php echo $_GET['URL'] ?>" + nocache, true);
request.onreadystatechange = function()
{
    if (this.readyState == 4)
    {
        if (this.status == 200)
        {
            if (this.responseText != null)
            {
                document.getElementById('info').innerHTML =
                this.responseText
            }
            else alert("Ajax error: No data received")
        }
        else alert( "Ajax error: " + this.statusText)
    }
}
request.send(null)
    function ajaxRequest()
    {
        try
        {
            var request = new XMLHttpRequest()
        }
        catch(e1)
        {
            try
            {
                request = new ActiveXObject("Msxml2.XMLHTTP")
            }
            catch(e2)
            {
                try
                {
                    request = new ActiveXObject("Microsoft.XMLHTTP")
                }
                catch(e3)
                {
                    request = false
                }
            }
        }
        return request
    }
</script>
</body>
</html>

However, it will not work if I take the written javascript and include it from an external url.

<?php  if (isset($_GET['url'])) {
echo file_get_contents("http://".sanitizeString($_GET['url']));
}
function sanitizeString($var) {
$var = strip_tags($var);
$var = htmlentities($var);
return stripslashes($var);
} ?>
<p>html text still displays</p>
<html>
<body>
<script src="urlget.js"></script>
</body>
</html>

I’m getting a 403 Forbidden Error. It’s telling me from request.send(null).

Access Forbidden
You don’t have permission to access the requested object. It is either read-protected or not readable by the server.

Do you have any idea how I can remedy this? I need the script to be an external file so I can include it on multiple websites.

  • 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-18T09:27:19+00:00Added an answer on June 18, 2026 at 9:27 am

    I think it is a file system permission issue. You must make sure that the web server has read access on the urlget.js file. You have to find out as which user is running the worker of the web server and give to that user read permission for urlget.js file.

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

Sidebar

Related Questions

In my Django templates, I have a couple pieces of code that are like
I have couple of dozen pieces of data that I need to save and
I have a couple of lines of code that work if use strict; is
I have couple of hyperlinks on my website. What I want is to remove
I have couple of formulas and data coming from database. I want to refresh
I have couple resource DLLs that I currently load when application starts using following
I have couple of questions about AS3 variables handling by AVM/compiler/scope .1. This code
We have couple different web-apps that share the same db link. The hibernate layer
ok I have couple of .NET classes that I want to use in VBA.
I have a bar that shows up (in rails) from a flash hash. I

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.