whoa that's pretty creative there. I've never seen the function usleep, but I just looked at the php manual and it was there.
the thing with ftp commands in php, is, on my system anyway, and I"ve heard this could be changed, if the script isn't finished within 30 seconds, it stops and throws a fatal error. so, if you use too many ftp commands on one page, it takes longer to execute, and often times when you have 25 / 30 files on a page listed, it will only get through to about 20 of them. so that's why I was trying to find something to maybe speed it up a bit.
and I just discovered how to find out how long it took the page to load, thanks to microtime.
I tried looking at net2ftp's code with some of the things it has on there...but with those types of scripts which are downloaded and used often, there are functions everywhere, and in about who knows how many files, and can't find what is where.
Brandon
Originally posted by Wynder
Here's the code:
<?php
sleep(2);
slow_type("Standby...<p>");
sleep(1);
slow_type("...Netcore Access Chip Detected.<br>");
sleep(1);
slow_type("...Encrypting Connection.");
sleep(2);
echo(" <b>Done!</b><br>");
slow_type("...Initializing Indentity Confirmation.");
sleep(1);
echo(" <b>Done!</b><br>");
slow_type("...Bringing up the network.<p>");
sleep(2);
echo("<body bgcolor=\"#000000\"><font color=white>");
echo("</pre>");
echo("<center><b>");
vslow_type("Welcome... ");
sleep(1);
echo(" =)");
?>
<?php
//And the accompanying functions:
//This function displays a string to appear as if it's being
//typed. Requires output_buffer=off in php.ini.
function slow_type( $message )
{
for($i = 0; $i < strlen($message); $i++ )
{
echo("$message[$i]");
usleep(rand(10000,100000));
}
}
//This function displays a string to appear as if it's being
//very slowly typed. Requires output_buffer=off in php.ini.
function vslow_type( $message )
{
for($i = 0; $i < strlen($message); $i++ )
{
echo("$message[$i]");
usleep(350000);
}
}
?>
[/B]