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

  • Home
  • SEARCH
  • 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 7724823
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T04:47:07+00:00 2026-06-01T04:47:07+00:00

I have this code to display the data retrieved from DB in accounts_view.php :

  • 0

I have this code to display the data retrieved from DB in accounts_view.php:

<script type="text/javascript">
function showPrice(str)
{
if (str=="")
  {
  document.getElementById("sender_price").innerHTML="";
  return;
  } 
if (window.XMLHttpRequest)
  {// code for IE7+, Firefox, Chrome, Opera, Safari
  xmlhttp=new XMLHttpRequest();
  }
else
  {// code for IE6, IE5
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
xmlhttp.onreadystatechange=function()
  {
  if (xmlhttp.readyState==4 && xmlhttp.status==200)
    {
    document.getElementById("sender_price").innerHTML=xmlhttp.responseText;
    }
  }
xmlhttp.open("GET","?action=account&q="+str,true);
xmlhttp.send();
}
</script>

I have problem in the below line :

xmlhttp.open("GET","?action=account&q="+str,true);

Just to explain to you I have index.php and have many cases there, I have

case "account" :

$q=$_GET["q"];

//code is here to get data from db and return with result..

include($_STR_TEMPLATEPATH."/account_view.php");

break;

So, When I am redirecting to ?action=account&q=str in the account_view.php

it displays the page again, so I will have 2 pages over each other.

I hope the problem is clear to you 🙂

Thanks and Regards,

  • 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-01T04:47:08+00:00Added an answer on June 1, 2026 at 4:47 am

    I would recommend using jquery to retrieve data from a database if you are wanting to use ajax. All the browser incompatibilities are already accounted for and you won’t have to bother coding for all the issues you will encounter trying to accomplish this by hand. basically why re-invent the wheel that is already perfectly created.

    Here is an example of my code using jquery and how easy it is to use.

    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <title>some title</title>
    <link href="customize.css" rel="stylesheet" type="text/css" media="screen" />
    <link href="css/black-tie/jquery-ui-1.8rc3.custom.css" rel="stylesheet" type="text/css" media="screen" />
    <script type="text/javascript" src="jquery-1.4.2.min.js"></script>
    <script type="text/javascript" src="jquery-ui-1.8rc3.custom.min.js"></script>
    <script type="text/javascript">
       function ShowActive(inputString){
         //gives visual that something is happening
         $('#Sresults').addClass('loading');
         //send your data to a php script here i am only sending one variable
         //if using more than one then use json format
         $.post("allactive.php", {queryString: ""+inputString+""}, function(data){
           if(data.length >0) {
             //populate div with results
             $('#Sresults').html(data);
             $('#Sresults').removeClass('loading');
           }
         });
       }
    </script>
    </head>
    <body>
      put your form here ....
      <div id="Sresults" name="Sresults"></div>
    </body>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using this code: <script type='text/javascript'> $(document).ready(function () { //Check if url hash value
I have the following code in the controller: function add() { if (!empty($this->data)) {
I have this code: def display(self): print self.doc.toprettyxml(indent= ) strigName ='/Users/my_user/Desktop/python/' + str(datetime.datetime.now()) +
I have this code which can display drop down in div tag of html.
I have this code: $(div[id^='intCell']).mouseover(function() { $(this).css({ border:,1px solid #ff097c}); }).mouseout(function() { $(this).css({border:,1px solid
I have this code to show a map using the Virtual Earth API: <script
I have this code here, which is intended to allow any type of arguments:
I have this code in my forms.py : from django import forms from formfieldset.forms
I have code to retrieve data from a database into a form but it
I have this code for doing an ajax request to a webservice: var MyCode

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.