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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T16:58:17+00:00 2026-06-15T16:58:17+00:00

I made an upload script where user uploads a file after the upload user

  • 0

I made an upload script where user uploads a file after the upload user get redirected to next page where i dump that file to database and show a gif image of loading data.. and then put sleep(10) to create delay and replace that image with showing data. Problem
I am facing is that after upload the code takes sleep(10) as execution time and display the final output on the next page no matter how many delays are being passed in that file and all those delays adds up to the execution time and shows the user final output after the dump is being done. Kindly let me know why is this happening.

Note I used flush () it didnot work either and its enabled in my config file

<?php 
flush();
ob_flush();
echo '<script language="javascript">document.getElementById("information").innerHTML="<img src='."images/L.gif".' />"</script>';
sleep(30);
echo '<script language="javascript">document.getElementById("information").innerHTML="<img src='."images/C.gif".' />"</script>';
 ?>
  • 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-15T16:58:19+00:00Added an answer on June 15, 2026 at 4:58 pm

    There are solutions to this (namely to flush after your echo statement and before your sleep statement). But, this isn’t likely to do what you want cross-browser anyway. AJAX would be a much better solution for this sort of task (most likely).

    Depending on the browser and configuration, the browser may not start rendering anything until the connection to your server is closed. In this case, the user will see nothing on their screen until all of your delays have passed.

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

Sidebar

Related Questions

I made an upload system where the user uploads a file and that file
I have a file upload script that works [finally] but want to have users
I'm trying to create a script that will upload a file to a website.
Lets say that we have an image uploaded by the user, the upload script
I have made a page that allows users to upload files to the server
I have made a html file, but when I upload and test it, I
I made an application that passes trough an XML file and extracts the entries
I am working on an image upload site. When the user uploads the images
I have a very simple file upload PHP script. I am testing with a
I made a small script which basically uses jQuery uplodify to upload files to

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.