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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T23:12:16+00:00 2026-06-13T23:12:16+00:00

I have a php file that produces a graph, populated through the answers of

  • 0

I have a php file that produces a graph, populated through the answers of 4 sql statements, in another php file i have a simple loop that requests the image by posting a variable through session to a variable nested within the sql of the image file.

i have checked that the ‘sent’ variable is iterating through my loop… but the problem is that if i want to itterate by 2 the 2 images i get are of the last result instead of graph1, graph2, i get graph2, graph2…

is their something i missing? Please any help – very new to PHP thanks 🙂
heres the loop;

<?php
session_start();

for ($i = 1; $i < 3; $i++)
{
    $_SESSION['question'] = $i;
    ?>
    <div id="apDiv1"><img src="round.php"></div>
    <?php
}
?>
  • 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-13T23:12:17+00:00Added an answer on June 13, 2026 at 11:12 pm

    is their something i missing?

    Yes, sessions in PHP are blocking. That means while your script in question runs, the round.php script does not run. It will wait until the script in question has finished.

    More correctly: even longer. The output must even go to the browser first.

    Then it provides you the graphs as images. The $_SESSION variable then is longtime to 2 already.

    Instead pass a query parameter ($_GET parameter), $_SESSION does not work here.

    <?php
    
    for ($i = 1; $i < 3; $i++)
    {     
        ?><div id="apDiv1"><img src="round.php?graph=<?php echo $i; ?>"></div><?php
    }
    
    ?>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a PHP file that contains a lot of if and else statements
I have a PHP file that serves up a JSON array populated from a
I have a jquery script that searches a php file that produces an XML
I have a PHP script that produces a .CSV export file from a MySQL
I have a PHP file with a line that produces a warning in NetBeans.
Hello there I have a really complex php script that produces a javascript file
I have a PHP file that contains a large array (about 90KB). I'm considering
I have a php file that contains a form (which contains 2 input boxes
I have a PHP file that I need it to detect it's directory it's
I have a php file that looks like this: <?php include(config.php); // put the

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.