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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T09:40:04+00:00 2026-06-09T09:40:04+00:00

I want script to redirect user as fast as it can and continue process

  • 0

I want script to redirect user as fast as it can and continue process data after user was redirected. I found this on google but It’s doesn’t work. It wait for 10 second before redirect.It’s seem that user need to wait till script is finish before browser can be direct.

<?PHP
 store data
 $userAgent = $_SERVER['HTTP_USER_AGENT'];
 $user_ip=$_SERVER['REMOTE_ADDR'];

 //Redirect to google
 header("Location: http://www.google.com");
 //Erase the output buffer
 ob_end_clean();
 //Tell the browser that the connection's closed
 header("Connection: close");

 //Ignore the user's abort (which we caused with the redirect).
 ignore_user_abort(true);

 //Extend time limit to 30 minutes
 set_time_limit(1800);
//Extend memory limit to 10MB
ini_set("memory_limit","10M");
//Start output buffering again
ob_start();

//Tell the browser we're serious... there's really
//nothing else to receive from this page.
header("Content-Length: 0");

//Send the output buffer and turn output buffering off.
ob_end_flush();
//Yes... flush again.
flush();

//Close the session.
session_write_close();

//After redirection no need to send any data to user anymore.
//User would It's seem that user need to wait till script is finish before browser can be direct.
//Do some work 
//sleep(10);
$matched = $wurflObj->getDeviceCapabilitiesFromAgent($userAgent);
$org = geoip_org_by_name($user_ip);

?>
  • 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-09T09:40:07+00:00Added an answer on June 9, 2026 at 9:40 am

    The other answers seem to be missing the point, why does the browser wait for the whole response to finish before redirecting.

    I’m not positive about it, but is it a given that browsers will redirect immediately upon receiving the Location header? Or is it done when the connection terminates? Use Firebug to see what the network connection is doing and see if it prints those headers before the 10 seconds is up, or if it appears after 10 seconds.

    In the Ruby on Rails world, the preferred solution is to send the job to a “delayed job” or “resqueue” server to run; this avoids trying to run long processes in a web server that needs to be available to handle web requests.

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

Sidebar

Related Questions

How to implement timeout in this code: Response.Write(@<script language='javascript'>alert('some alert');</script>); Response.Redirect(Request.ApplicationPath); I want to
If I want to redirect the user from a cgi script to a HTML
can I have a question about how to redirect the page after user invite
I just want to redirect the user to google search when he type some
I want to redirect to another page when a checkbox is clicked. <script type=text/javascript><!--
I want my perl script to be able to do this: $ ./code file.txt
I have a mobile script from detectmobilebrowsers.com that will redirect the user to my
I do not know the right term for this but say I want to
How can I redirect user based on host in aspx page? For example, I
I have a form. This form will submit data to 2 different pages. After

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.