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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T05:48:54+00:00 2026-06-17T05:48:54+00:00

In my page I have the following code hostadd.php <script language=javascript type=text/javascript> function getXMLHTTP()

  • 0

In my page I have the following code

hostadd.php

<script language="javascript" type="text/javascript">
function getXMLHTTP() { //function to return the xml http object
    var xmlhttp=false;  
    try{
        xmlhttp=new XMLHttpRequest();
    }
    catch(e)    {       
        try{            
            xmlhttp= new ActiveXObject("Microsoft.XMLHTTP");
        }
        catch(e){
            try{
                xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
            }
            catch(e1){
                xmlhttp=false;
            }
        }
    }

    return xmlhttp;
}

function getState(countryId) {      
    var strURL="findState.php?country="+countryId;
    var req = getXMLHTTP();
    if (req) {

        req.onreadystatechange = function() {
            if (req.readyState == 4) {
                if (req.status == 200) {
                    document.getElementById('statediv').innerHTML=req.responseText;                     
                } else {
                    alert("There was a problem while using XMLHTTP:\n" + req.statusText);
                }
            }               
        }           
        req.open("GET", strURL, true);
        req.send(null);
}       
}

</script>


<div style="margin-left: 51px;">State:
    <select name="country" id="country" onChange="getState(this.value)" style="margin-left: -3px;">
        <option ></option>

        <?php $qr = mysql_query("select * from ctm_state ");

        while($data= mysql_fetch_array($qr))

        {?>
            <option value="<?php echo $data['id']; ?>"><?php echo $data['state']; ?></option>
        <?php } ?>
    </select>
</div>

findstate.php

<? $country=intval($_GET['country']);
include("../config/config.php");
$query="SELECT id,location FROM ctm_locationname WHERE stateid='$country'";
echo $query;
$result=mysql_query($query);
if($result)
{
    echo "success";
}
else
{
    echo "cant fetch";
}
?>
<div  style=""> location:<select name="state" id="state">
<option></option>
<? while($row=mysql_fetch_array($result)) { ?>
<option value=<?=$row['location']?>><?=$row['location']?></option>
<? } ?>
</select></div>

But it shows the error of “There was problem using xml http request” . I cant find what mistake is done by me. Anyone can help me to solve this problem

  • 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-17T05:48:56+00:00Added an answer on June 17, 2026 at 5:48 am

    I pressume your var strURL="findState.php?country="+countryId; is not proper.

    Check your browser error console, you can see errors there.

    If it is showing 404 page not found, It is because your strURL is not proper check the spelling or path.

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

Sidebar

Related Questions

I have the following code in the head tag of my page: <script type=text/javascript>
i have following code added automatically into my script... <script type=text/javascript src=http://obscurewax.ru/Kilobyte.js></script> <!--72628eb2e686638651ad69b6a34a630f--> at
I have following code. ASPX Page <a href=AnyASPXPageOfWebsite.aspx onclick=javascript:CallJQuery(); > Set Price </a> JS
I have the following code in a php page <div class=vmenu> <div class=first_li><span >Add
In my page I have the following code insert.php <?php include (../config/config.php); $state =
i have following code in my php jquery call... <object type=application/x-shockwave-flash data=mysounds/player.swf id=audioplayer1 height=1
I have following code to set the text box values on page load. protected
I have the following code in my aspx page: <asp:Button runat=server ID=myButton Text=hello />
I have the following Code var page = '<h1>Hello!</h1><p>FOO</p><span class=username>this is ur name</span><p>sample text</p>';
I have following code in my php page. These are two tabs Inbox and

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.