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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T17:18:31+00:00 2026-05-27T17:18:31+00:00

Please bear with me, I need help. On my site: index.php – displays 20

  • 0

Please bear with me, I need help.

On my site:

  1. index.php – displays 20 links in this form:

    $result = mysql_query("my query");
    
    while($slice = mysql_fetch_assoc($result)){
         $url = $slice['url'];
         $perf  = $slice['perf']; 
    
         <a class="ajaxquery" data-title="<? echo $perf; ?>" href="$<? echo $url ?>">anchor</a>
    
    endwhile;
    
  2. If someone clicks on one of the 20 links, I have this ajax code, which see’s which $perf is clicked, sending the data to session.php:

    function ajaxsession(){
        $("a.ajaxquery").click(function() {
            var perf = $(this).data('title');
            $.ajax({ type: "POST", url: "/session.php", data: "perf="+perf, success: function(html){ $("#results").append(html); } });
        });
    }
    
  3. This code sends the following to session.php:

    session_start();
    $_SESSION['perf'] = $_POST['perf']; // Store session data
    
  4. And on my single.php page I call the variable stored in the session:

    echo $_SESSION['perf'];
    

On single.php I get the right $perf as long as I get back to index.php using the home link.

If I get back to index.php using the browsers back arrow, then the $perf is not updated using the onclick jQuery code.

Do you have any ideas on why is this happening? I am thinking that maybe I should destroy the session somehow once it reaches single.php. Is that a good idea?

  • 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-27T17:18:32+00:00Added an answer on May 27, 2026 at 5:18 pm

    ‘back button’ will usually return to and load a cached copy of the page. If you need to have that “previous” page automatically reload when the user goes “back” to it, you’ll have to send out that page with no-cache headers when it’s first loaded.

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

Sidebar

Related Questions

I am new to this, so please bear with me... I need to very
But please bear with me. I do not need help with ndns or JavaScript.
Please bear with me if this question isn't well formulated. Not knowing is part
I am new to bash so please bear with me if this is a
This question is a bit long, please bear with me. In REST, i think
Firstly this has turned out to be quite a long post so please bear
This is my first question here on stack overflow. i need help on a
I have a form field in Drupal which I need some help with. The
I'm new to Makefiles so please bear with me. I need to modify a
Please bear with me -- I know this is complex. I have a table

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.