Ir para conteúdo
Fórum Script Brasil

dcdias21

Membros
  • Total de itens

    13
  • Registro em

  • Última visita

Tudo que dcdias21 postou

  1. Olá, Não encontrei nada nem no manual e nem no google. O mas próximo que cheguei foi em um fórum onde um dos membros enviou o código abaixo e pediu para os outros testarem, mas não cheguei nem a ler o código. Da uma analizada e se funcionar mesmo me da um toque. Abs <?php /*** Bandwidth Tester 0.92 ***/ /* Please wait for 1.0 patiently! */ // How many bytes to test with. Mimimum=70. 128KB=131072. 1MB=1048576 $testsize = 131072; header ("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Date in the past header ("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); // always modified header ("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1 header ("Pragma: no-cache"); // HTTP/1.0 header ("X-Notice: "); header ("X-Notice: Bandwidth-Tester is freeware."); header ("X-Notice: You may use it freely on your site."); header ("X-Notice: Just don't remove this notice."); header ("X-Notice: To get the source code, run this script "); header ("X-Notice: with downloadme=1 in the query string."); /* How does it work? The script generates a variable amount of random data * sends it to the client and measures the time taken for transmission. The * bandwidth is then calculated from the time using a simple algorithm. * * WARNING: This script can bog down your server - as absolutely NO * optimization was used. * * * This script is best run on the Zend PHP Engine, with Zend Optimizer. * Any improvement in performance is not guaranteed with other * PHP Engines. * * History: * 0.9 - First public release * 0.91 - Reduced the size of the timing code * 0.92 - Reduced the size of the timing code even more * Forecast: * 0.921a - Adding a smaller test before the main to make results more accurate and to adjust test data according to first results * 1.0 - Looking to adding optimization code * 1.1 - Adding template support * 1.2 - Adding web-based administration */ if($downloadme==1){ echo "<html><body>"; show_source($SCRIPT_FILENAME); echo "</body></html>"; } else { // First, initialize the test comment // seed random srand ((double) microtime() * 1000000); if($testsize<70) {die("<script>alert('The test string size is less than 70. Cannot test.')</script>"); } $realtestsize = $testsize - 70; function GetTestString($drealtestsize){ $duhteststring = "<!"."--"; for($i=0;$i<$drealtestsize; $i++){ $duhteststring .= generatekeycode(); } $duhteststring .= "-"."->"; return $duhteststring; } function CalculateBandwidth($Ditt,$Dott){ $Datasize=$Dott; $LS=$Datasize/$Ditt; $kbps=(($LS*8)*10*1.02)/10; $mbps=$kbps/1024; if($mbps>=1){$speed=$mbps." Mbps aka ".$kbps." Kbps";} else {$speed=$kbps." Kbps aka ".$mbps." Mbps";} $speed .="<br>Time taken to test connection: ".(($Ditt*1024)/1000)." Seconds <br>A number used to determine your speed: ".$LS."<br>Another number used to determine your speed: ".$Ditt."<br>Tested your connection with ".$Datasize."Bytes/".($Datasize/1024)."KB/".($Datasize/1048576)."MB of random data<br>"; return $speed; } function generatekeycode(){ // srand ((double) microtime() * 1000000); // Made the randomizer a little more "random"! srand ((double) microtime() * rand(100000,1000000) / rand(1,15)); $tester = rand(33,255); if($tester==45)return generatekeycode(); return chr($tester); } ?><html> <head><title>Bandwidth Tester</title></head> <body><?php if($HTTP_SERVER_VARS["REQUEST_METHOD"]==GET" && $HTTP_GET_VARS["execute]!="1"){ echo('<form action="'.$HTTP_SERVER_VARS["SCRIPT_NAME"].'" method=GET"> <input type="submit" value="Click Here To Begin Testing" onClick="this.value=\'Please wait while your request is being processed, it may take a while\'"> <input type="hidden" name="execute" value="1"> <input type="hidden" name="DO.NOT.CACHE" value="'.rand(255,65536).'"> </form>');} elseif($HTTP_GET_VARS["execute]=="1"){ $teststring=GetTestString($realtestsize);echo('<form method="POST" action="'.$HTTP_SERVER_VARS["SCRIPT_NAME"].'"> <input type=hidden" name="td" value="No Test"> <input type="button" value="Please wait while your request is being processed, it may take a while"> </form> <script language="JavaScript"> var Hi = new Date(); </script>'.$teststring.'<script language="JavaScript"> var Bye = new Date(); var NiHao = new Array(Hi.getTime(),Bye.getTime()); var Factor=1024; if(NiHao[1]==NiHao[0]) Ditt=0; else Ditt=(NiHao[1]-NiHao[0])/Factor; document.forms[0].elements[0].value=Ditt; document.forms[0].submit(); </script><p>Tested. Now processing your request....</p>');} elseif($HTTP_SERVER_VARS["REQUEST_METHOD]=="POST"&&$HTTP_POST_VARS["td"]>0){ echo('<p>We have tested your Internet connection.<br> The speed to which you connected to us is '.CalculateBandwidth($HTTP_POST_VARS["td"],$testsize).' Thank you!<br> <a href=?downloadme=1">Would you like one of these on your site? Click here.</a> </p>');} elseif($HTTP_SERVER_VARS["REQUEST_METHOD]=="POST"&&$HTTP_POST_VARS["td"]==0){ echo('<p>We were unable to test your connection speed.<br>It was too fast to measure.<br> <a href='.$HTTP_SERVER_VARS["SCRIPT_NAME].'?execute=1&DO.NOT.CACHE='.rand(255,65536).'" onClick="this.innerText=\'The system is now generating the random test data to benchmark your connection speed. It will take a while.\'">If you would like to try testing again, click here.</a></p> <p>'.CalculateBandwidth($HTTP_POST_VARS["td"],$testsize).'</p>'); } ?> </body> </html><?php } ?>
  2. dcdias21

    Inlcuir E Escluir No Banco...

    Quando você utiliza um checkbox em um formulário você passa parametros por ele. Não enten di qual a sua dúvida!
  3. dcdias21

    Dúvidas Sobre Thumbanail

    Pelo que eu li, só deve estar aparecendo a palavra teste nas células. Estou certo?
  4. dcdias21

    Session..

    Este limite e definido na configuração do PHP de acordo com o cache. Se a opção estiver setada para 'nocache' (padrão) este valor fica indefinido. tente o comando abaixo para descobrir como a opção está setada. session_cache_limiter -- Obtém e/ou define o limitador do cache atual Abraços.
  5. Acho que sua pergunta já foi respondida, se não me engano no HiperFórum. Caso tenha me enganado poste alguma coisa ai.
  6. dcdias21

    Ftp_chmod

    A biblioteca de funçoes ftp fou construida a partir da versão 4.0.3 do php, e para usálas você tem que ter compilada, junto com o php a biblioteca php_ftp.dll. Abraços.
  7. dcdias21

    Ler Frase Entre Caracter

    <? $abrir=fopen('arquivo.txt','r'); if($abrir){ while(!feof($abrir)){ $car=fgetc($abrir); while(($car!='<')&&(!feof($abrir))){ $car=fgetc($abrir); } $car=fgetc($abrir); while(($car!='>')&&(!feof($abrir))){ $frs=$frs.$car; $car=fgetc($abrir); } $frs=$frs.'<br>'; } echo $frs; } ?> Percebi que o código não ficou identado na resposta acima, portanto estou postando de novo.
  8. dcdias21

    Ler Frase Entre Caracter

    você vai ter que ler um caracter de cada vez e ir testando ate que encontre o '<' ai armazena ate encontrar o '>'. <? $abrir=fopen('arquivo.txt','r'); if($abrir){ while(!feof($abrir)){ $car=fgetc($abrir); while(($car!='<')&&(!feof($abrir))){ $car=fgetc($abrir); } $car=fgetc($abrir); while(($car!='>')&&(!feof($abrir))){ $frs=$frs.$car; $car=fgetc($abrir); } $frs=$frs.'<br>'; } echo $frs; } ?>
  9. Olá, Como está definida a estrutura de sua tabela?
  10. dcdias21

    2 Dúvidas

    Olá, Quanto ao java script não posso lhe ajudar muito, e quanto ao bd não entendi muito bem o por que de você ter registros iguais, porém poste a parte do código onde você está fazendo esta query e lhe mostro como. Abraços!
  11. dcdias21

    Pequena Duvida

    Qual banco de dados você está usando? MySQL ou Postgre?
  12. dcdias21

    Php+mysql+ Tiff

    Olá, Desenvolvi um sistema para gerenciamento e armazenamento de imagens. Até agora tudo beleza mas preciso começar a trabalhar com imagens no formato .tiff, ate então utilizei somente imagens no formato .jpg. Se alguém fizer ideia do que estou falando e puder me ajudar. Grato.
×
×
  • Criar Novo...