Results 1 to 2 of 2

Thread: xmlhttp.open("GET",url,true) access is denied

  1. #1
    Join Date
    Jun 2010

    xmlhttp.open("GET",url,true) access is denied

    I have searched the forums for a solution, however I cant seem to find one. Forgive me if there was and I couldnt find it. My problem is that every time I send my form, the script stops at the line xmlhttp.open("GET",url,true); and says access is denied. I know there are security issues, but I am using php to send the information to the script. The goal here is to scan the url for all the contents from google search. I am searching for a city, state and postal zip. That will give the according information. Here is my code:

    var xmlhttp;
    function getdata(){
    if (xmlhttp==null){
    var div=document.getElementById('result');
    //my variables are declared here


    xmlhttp.setRequestHeader("Content-Type", "text/html;charset=UTF-8");
    function stateChanged(){
    if (xmlhttp.readyState==4) {
    var res_text=xmlhttp.responseText;
    var myObject = eval('('+res_text+')');

    function GetXmlHttpObject(){
    if (window.XMLHttpRequest){
    return new XMLHttpRequest();
    if (window.ActiveXObject){
    return new ActiveXObject("Microsoft.XMLHTTP");
    return null;

    That was my java script that suppose to display the json formatted contents.

    Now my php file:
    //variable declarations are here

    $data["input"] = "json";
    $data["output"] = "json";

    $params = array (
    'http' => array (
    'method' => 'POST',
    'header' => 'Accept-Language: en-us\r\n'.
    'User-Agent: Mozilla/4.0',
    'content' => $data ) );

    $ctx = stream_context_create ( $params );
    $return = file_get_contents("http://maps.google.com/maps/geo?q=$city,$state,$zip&$google_key&output=json&radius=$radius", false, $ctx );

    This should solve the security issue but i am still getting the access denied error at the same line. I even tried redoing it all in javascript still no luck. Any help would be appreciated.

  2. #2
    Join Date
    Oct 2006
    I have a script I can only use with Internet Explorer. Since its only for my own use
    and local, I have not looked to make it xBrowser. It is similar to yours but different,
    it reads source files of URLs, then I can manipulate that file as a string to get certain elements
    and information practical to rewrite the page with only the bits I'm interested in.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center