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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T16:05:15+00:00 2026-06-01T16:05:15+00:00

This is my first time asking a question in this website so please bear

  • 0

This is my first time asking a question in this website so please bear with me. I got a script from another website for testing internet connection speed and added if else statement. If the speed is more than 500, it will redirect to a specific page. For some reasons, I can’t make it to work. I have added the ob_start(); before the <html> tag and also added ob_end_flush(); after the </html> tag. I have added the code below in between my body tags.

$kb=512;
flush();
$time = explode(" ",microtime());
$start = $time[0] + $time[1];

for($x=0;$x<$kb;$x++){
    echo str_pad('', 1024, '');
    flush();
}
$time = explode(" ",microtime());
$finish = $time[0] + $time[1];
$deltat = $finish - $start;
$intspeed = round($kb / $deltat, 0);
echo $intspeed; //just to check if $intspeed has a value

if ($intspeed > 500) {
  header("Location: test.php"); 
  exit();
} else  {
  header('Location: falcons/index.php');
  exit();   
}
  • 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-01T16:05:16+00:00Added an answer on June 1, 2026 at 4:05 pm

    Remove the flush(); calls. Also, ensure that this code is between ob_start() and ob_end_flush(), not before or after (and also that nothing else is output before this code).

    $kb=512;
    
    $time = explode(" ",microtime());
    $start = $time[0] + $time[1];
    
    for($x=0;$x<$kb;$x++){
        echo str_pad('', 1024, '');
    }
    $time = explode(" ",microtime());
    $finish = $time[0] + $time[1];
    $deltat = $finish - $start;
    $intspeed = round($kb / $deltat, 0);
    echo $intspeed; //just to check if $intspeed has a value
    
    if ($intspeed > 500) {
      header("Location: test.php"); 
      exit();
    } else  {
      header('Location: falcons/index.php');
      exit();   
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is my first time asking a question, please be gentle! I have a
This my first time asking a question so please go easy one me :-p
First time using this service for a question. I hope I am not asking
First of all this is the first time I am asking a java question
this is my first time to work with API's in PHP, so please bear
This is my first time asking my question at stackoverflow. I'm working on a
this is my first time asking a question here so apologies if I am
this is my first time asking a question here so I hope I am
This is the first time i'm asking a question here at stack overflow so
Well this is not the first time im asking these question here but I

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.