coder-007 Posted May 11, 2014 Share Posted May 11, 2014 I am trying to make ISP speed test PHP script, but it is not working as it should. Please see this webpage: http://www.maxspeed.lt/ And here is my .php index file source code: <?php if (isset($_GET['source'])) { highlight_file($_SERVER['SCRIPT_FILENAME']); exit; } $maxNumKB = 4096; $defNumKB = 512; if (!isset($_GET['numKB']) || intval($_GET['numKB']) > $maxNumKB) { header("Location: http://{$_SERVER['HTTP_HOST']}{$_SERVER['PHP_SELF']}?numKB=$defNumKB"); exit; } $numKB = intval($_GET['numKB']); ?> <!DOCTYPE html> <head> <meta http-equiv="Content-Type" content="text/html; charset=windows-1252"> <title>maxspeed.lt | Klaipeda | Svetainiu Kurimas. Grafinis Dizainas. Verslo Sprendimai.</title> <meta name="description" content="+370 60 22 11 62. Website Creation. Graphic Design. Business Services. Svetainiu kurimas. Grafinis Dizainas. Verslo Sprendimai."/> <link rel="stylesheet" type="text/css" href="http://www.maxspeed.lt/default.css"/> <link href="http://www.maxspeed.lt/favicon.ico" rel="icon" type="image/x-icon" /> <meta property="og:image" content="http://www.maxspeed.lt/images/maxspeed-logo.jpg"/> <meta property="og:title" content="maxspeed.lt | Klaipeda"/> <meta property="og:description" content="Jai esate klaipedieciai, Prasom spauskit patinka. Aciu, linkejimai Jamesas. maxspeed.lt Verslo Sprendimai +370 60 22 11 62 .Svetainiu kurimas. Grafinis Dizainas."/> <style type="text/css"> <!-- #wait { border-bottom: thin dotted black; } #wait abbr { border: none; } #done { font-weight: bold; } #benchmark { padding: 1em; border: 1px solid black; background: #ffe; color: #000; } </style> </head> <body> <div id="benchmark"> <p> <strong>Maxspeed.lt ISP Speed Test</strong> </p> <p> This script sends <?php echo $numKB; ?> <abbr title="kilobyte">KB</abbr> of HTML comments to your client. Parsing that HTML may add to the total transfer time, so do not take this as your raw download speed. </p> <p id="wait"> Transferring <?php echo $numKB; ?> <abbr title="kilobyte">KB</abbr> </p> </div> <?php function getmicrotime() { list($usec, $sec) = explode(" ", microtime()); return ((float)$usec + (float)$sec); } flush(); $timeStart = getmicrotime(); $nlLength = strlen("\n"); for ($i = 0; $i < $numKB; $i++) { echo str_pad('', 1024 - $nlLength, '/*\\*') . "\n"; flush(); } $timeEnd = getmicrotime(); $timeDiff = round($timeEnd - $timeStart, 3); ?> <p id="done"> <?php echo "Transferred {$numKB} <abbr title=\"kilobyte\">KB</abbr> in {$timeDiff} seconds, " . ($timeDiff <= 1 ? "more than {$numKB}" : round($numKB / $timeDiff, 3)) . ' <abbr title="kilobytes per second">KB/s</abbr>'; ?> </p> <center> <p><span id="topText"><a href="http://www.maxspeed.lt/">maxspeed.lt verslo sprendimai +370 60 22 11 62</a></span></p> <br><br><br><br><br><br><br><br><br> <span id="mainTitle">KLAIPEDA</span> <br><br> <div id="navBar"> <input id="searchBox" type="text" placeholder="Paieska KLAIPEDA"> <input id="searchButton" type="image" src="icon_searchMag.png"> </div> <script type="text/javascript" src="jquery.min.js"></script> <script type="text/javascript" src="jquery.placeholder.min.js"></script> <script> $(function() { $('input, textarea').placeholder(); }); </script> <script> function changePlaceholder() { var placeHolders = new Array(), placeHolders[0] = "Search Klaipeda Businesses"; placeHolders[1] = "Search Klaipeda Maps"; placeHolders[2] = "Search Klaipeda Information"; var x = 0; $('#searchBox').attr('placeholder', placeHolders[x]); x++; if(x >= placeHolders.length) { x = 0; } setTimeout('changePlaceholder()', 3000); } t = setTimeout('changePlaceholder()', 3000); </script> <span id="urlShare"></span> <span id="search10"> <u>Klaipedos Imoniu katalogas</u> <ul> <li><a href="http://www.maxpeed.lt/labanga"><b>www.labanga.lt</b> Labanga Klaipeda (Kitesurfingo parduotuve)</a> Big2 Taikos prospektas 141, LT-94284 KLAIPEDA - +370 623 40172 <br></li> <li><a href="http://www.acura.lt/"><b>www.acura.lt</b> ACURA, UAB parduotuve</a> Tilzes g. 53, LT-91260 KLAIPEDA - +370 646 21113 <br></li> <li><a href="http://www.alkena.lt/"><b>www.alkena.lt</b> ALKENA, UAB</a> Dubysos g. 19, 2 a., LT-93232 KLAIPEDA - +370 687 34818 <br></li> <li><a href="http://www.apoil.lt/"><b>www.apoil.lt</b> APOIL, II</a>Garazu g. 2, LT-92101 KLAIPEDA - +370 646 314335 <br></li> <li><a href="http://www.komanda.lt/"><b>www.komanda.lt</b> APSAUGOS KOMANDA, UAB Klaipedos filialas</a> Taikos pr. 27A, LT-91144 KLAIPEDA - +370 646 343070 <br></li> <li><a href="http://www.bakra.eu/"><b>www.bakra.eu</b> BAKRA, UAB Klaipedos filialas</a> LT-93154 KLAIPEDA - +370 687 23212 <br></li/li> <li><a href="http://www.balticmaster.lt/"><b>www.balticmaster.lt</b> BALTIC MASTER, UAB Klaipedos biuras ir parduotuve</a> Dubysos g. 66A, LT-94107 KLAIPEDA - +370 646 341222 <br></li> <li><a href="http://www.belfuel.eu/"><b>www.belfuel.eu</b> BELFUEL, UAB</a> Naujoji Uosto g. 8-307 (3a), LT-92125 KLAIPEDA - +370 646 218020 <br></li> <li><a href="http://www.evaking.lt/"><b>www.evaking.lt</b> EVA KING, UAB Klaipedos skyrius</a> Paryziaus Komunos g. 25, LT-91111 KLAIPEDA - +370 686 43203 <br></li> <li><a href="http://www.fcrmedia.lt/"><b>www.fcrmedia.lt</b> FCR MEDIA LIETUVA, UAB Klaipedos biuras</a> Minijos g. 123-49, LT-93224 KLAIPEDA - +370 646 310580 <br></li> <li><a href="http://www.finaneta.lt/"><b>www.finaneta.lt</b> FINANETA, UAB</a> Taikos pr. 32A-4, 3 a., LT-91235 KLAIPEDA - +370 646 494505<br></li> <li><a href="http://www.gaudre.lt/"><b>www.gaudre.lt</b> GAUDRE, UAB Klaipedos filialas</a> Taikos pr. 24, LT-91222 KLAIPEDA - +370 646 383390 <br></li> <li><a href="http://www.genys.lt/"><b>www.genys.lt </b> GENYS, UAB Klaipedos atstovybe</a> Dubysos g. 31A, LT-91181 KLAIPEDA - +370 46 340720 <br></li> <li><a href="http://www.1588.lt/"><b>www.1588.lt</b> INFOMEDIA, UAB Klaipedos biuras</a> Baltijos pr. / Minijos g. 123-49, LT-93224 KLAIPEDA - +370 646 314457<br></li> <li><a href="http://www.javine.lt/"><b>www.javine.lt</b> JAVINE, UAB</a> Minijos g. 45, LT-91208 KLAIPEDA - +370 646 340370 <br></li> <li><a href="http://www.ports.lt/"><b>www.ports.lt</b> KLAIPEDOS LAIVU REMONTAS, AB</a> Pilies g. 4, LT-91240 KLAIPEDA - +370 646 490990 <br></li> <li><a href="http://www.imones.lt/nairuva/"><b>www.imones.lt/nairuva</b> NAIRUVA, II</a> Taikos pr. 58 (SILAS, 2 sale), LT-91183 KLAIPEDA - +370 699 96988 <br></li> <li><a href="http://www.nordtext.com/"><b>www.nordtext.com</b> NORDTEXT, UAB</a> Taikos pr. 52C/ Agluonu g. 1, LT-91184 KLAIPEDA - +370 646 420315<br></li> <li><a href="http://www.savimedziosprendimai.lt/"><b>www.savimedziosprendimai.lt</b> SAVI MEDZIO SPRENDIMAI, MB</a> Vyturio g. 19-16, LT-95184 KLAIPEDA - +370 610 03474 <br></li> <li><a href="http://www.takareklama.lt/"><b>www.takareklama.lt</b> TAKA REKLAMA, T. Kasakausko individuali veikla</a> Silutes pl. 27, LT-91110 KLAIPEDA - +370 673 82669 <br></li> <li><a href="http://www.klinikazavesys.lt/"><b>www.klinikazavesys.lt</b> ZAVESYS, UAB</a> Nidos g. 1B, LT-93220 KLAIPEDA - +370 646 341205<br></li> </ul> <u>Domenas svetaines Portfelio</u> <ul> <li><a href="http://bpoutpost.com/"><b>bpoutpost.com</b> Bpoutpost Battle Pirates Strategy Wiki</a><br></li> <li><a href="http://bpoutpost.com/shipyard/"><b>ushipyard.com</b> Battle Pirates Ultimate Shipyard Fleet Planner</a><br></li> <li><a href="http://www.bauzinski.com/"><b>www.bauzinski.com</b> Travel Baltic with Andrius Bauzinskas</a><br></li> <li><a href="http://jsbseafoods.co.uk/"><b>jsbseafoods.co.uk</b> JSB Seafoods Fleetwood Blackpool Fish Supplier</a><br></li> <li><a href="http://wiki-dj.com/"><b>wiki-dj.com</b> Free-content DJ encyclopedia project</a><br></li> <li><a href="http://www.instaworldcup.com/"><b>www.instaworldcup.com</b> LIVE from WORLD CUP 2014</a><br></li> </ul> </span> </center> </body> </html> Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.