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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T11:02:58+00:00 2026-05-13T11:02:58+00:00

Sorry folks but I asked a question earlier and perhaps did not explain myself

  • 0

Sorry folks but I asked a question earlier and perhaps did not explain myself very well at all. I answered the question myself to prevent further replies and hopefully to reset the question in a more basic format, as none of the answers worked/explained to me, stress to me, how to do it. There were 4 totally different answers to one basic question.

I had hoped the question was quite simple – take a variable from an href then pass that variable through JQuery/ajax to another page and return the results into a div on the original page. In php it is simple i.e.

if(isset($_GET['nameofvariable']): // do this // endif;

I tried all the answers in my previous question with a simple echo $_GET[‘nameofvariable’]; on the receiving page but none of them give me the right result – sorry. Perhpas a simpler version will help me (and hopefully others)

Starting page call it index.php contains just 1 link

<a href="?abc=1" id="#idoflink">Try again</a>

and one div

<div id="testit"></div>

I want to pass “abc” to another page say testit.php which contains 1 line of code

<?php echo $_GET['abc']; ?>

Then print $_GET[‘abc’] into the div id=”testit”

OK, before you all shout, I want to use ajax (or similar) as when I understand this basic function – i.e. sending the variable and getting it to print out into the div id=”testit” I then want to run a query on the page testit.php based on the variable abc and to return the results of that query into the div id=”testit” without having to refresh the page.

I am trying to learn this Jquery/Ajax thingy, have a reasonable grasp of php – can do this in php but needs a page refresh for my purpose I cannot have a page refresh (even a small one in terms of the time taken to run the eventual query).

Beyond this by being able to understand this simple functionality – ie. send a GET to another page and perform a query and return I can then “develop it out” from my other understandings of JQuery/Ajax and my PHP knowledge.

Sorry if blunt. Thanks for any answers.

  • 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-05-13T11:02:58+00:00Added an answer on May 13, 2026 at 11:02 am

    If I understand what you want to do correctly, you can get by with jQuery’s .load function, its simplest AJAX call. The following two files give a simple example of how it might work (index.php makes an AJAX call to test.php and displays its results in the div):

    index.php:

    <head>
    <script src="http://www.google.com/jsapi"></script>
    <script>google.load("jquery", "1.3.2");</script>
    
    <script>
      $(document).ready(function() {
        $("#idoflink").click(function() {
          $("#test").load("test.php?abc=1");
        });
      });
    </script>
    </head>
    
    <body>
    <a href="#" id="idoflink">Try again</a>
    <div id="test"></div>
    </body>
    

    test.php:

    <?
      print "abc = " . $_GET["abc"];
    ?>
    

    EDIT:

    In response to your comment, if you want to read the href, you can replace the onclick function with this

    $("#idoflink").click(function(){
      $("#test").load(this.href);
      this.href = "#";
    });
    

    and the link with:

    <a href="test.php?abc=1" id="idoflink">Try again</a>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Sorry but I am not sure how to ask this question but I am
Sorry the title is not very descriptive but it is a tricky problem to
Sorry if i posted this here wrong. But i sort of did not know
Sorry for this not being a real question, but Sometime back i remember seeing
Sorry if this question's been asked before, but I can't seem to find an
sorry for lamer question, but I really could not found subject. I have a
Sorry to bother you folks. But i have a simple question. Ho can I
Sorry for question but I can't find answer anywhere on internet. I couldn't find
Sorry for this simple question, but I can't solve it... There is an example:
Sorry, I know this question is easy, but I don't know how to get

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.