how do i do the following??

Links for php scripts

Moderators: macek, egami, gesf

nathanwebb6
New php-forum User
New php-forum User
Posts: 27
Joined: Sat Jul 05, 2003 5:08 pm
Location: england uk
Contact:

how do i do the following??

Postby nathanwebb6 » Sat Jul 05, 2003 5:11 pm

hey, i have made a speed test, and it works fine, but once it has ran once, the image it downloads to calcualte the results is on the users computer. Even when it is on the computer, i still need the image to load from scratch if he does it again, so what script can i use to make images load from the site and not a users system??

User avatar
bezmond
Moderator
Moderator
Posts: 312
Joined: Sat Apr 05, 2003 4:33 am
Location: Mansfield, UK
Contact:

Postby bezmond » Sun Jul 06, 2003 1:28 am

try using the following:
<?
$number = rand(1,100000000);
?>
then insert the image, e.g. <img src="result.jpg?n=<? echo $number ?>">

That *should* force cache to reload the image, but the ?n= will be ignored completely!

Andrew

nathanwebb6
New php-forum User
New php-forum User
Posts: 27
Joined: Sat Jul 05, 2003 5:08 pm
Location: england uk
Contact:

Postby nathanwebb6 » Sun Jul 06, 2003 4:58 am

hey, thanks! ill give that a try.

nathanwebb6
New php-forum User
New php-forum User
Posts: 27
Joined: Sat Jul 05, 2003 5:08 pm
Location: england uk
Contact:

i got the whole script working accuratly!

Postby nathanwebb6 » Sun Jul 06, 2003 9:38 am

thanks from the peson that replied! if you want to test your connection speed, just goto http://hosted.barrysworld.net/naysgames ... edtest.php

User avatar
bezmond
Moderator
Moderator
Posts: 312
Joined: Sat Apr 05, 2003 4:33 am
Location: Mansfield, UK
Contact:

Postby bezmond » Sun Jul 06, 2003 10:44 am

I take it that worked? :)

Regards,
Andrew

User avatar
WiZARD
Moderator
Moderator
Posts: 1257
Joined: Thu Jun 20, 2002 10:14 pm
Location: Ukraine, Crimea, Simferopol
Contact:

Re: i got the whole script working accuratly!

Postby WiZARD » Mon Jul 07, 2003 5:39 am

nathanwebb6 wrote:thanks from the peson that replied! if you want to test your connection speed, just goto http://hosted.barrysworld.net/naysgames ... edtest.php

test RESULTS ARE AS FOLLOWING...
Your Connection speed is 7564.2764578834 bytes per second
Your Connection Speed is 7.3869887284017 kiloBYTES per second
Your Connection Speed is 59.095909827214 kiloBITS per second (this is what your modem is measured in)
A 1 megabyte download would take 138.9 seconds

nathanwebb6
New php-forum User
New php-forum User
Posts: 27
Joined: Sat Jul 05, 2003 5:08 pm
Location: england uk
Contact:

heyy... :(

Postby nathanwebb6 » Tue Jul 15, 2003 2:22 pm

hey... i did use google :P thats how i found this site in the first place lool

nathanwebb6
New php-forum User
New php-forum User
Posts: 27
Joined: Sat Jul 05, 2003 5:08 pm
Location: england uk
Contact:

btw

Postby nathanwebb6 » Tue Jul 15, 2003 2:33 pm

by the way, i dont know when you took that test, but if the results were way out of your real connection speed, try taking it again, because i have set it to run in a different way now which is much more accurate!

User avatar
swirlee
Moderator
Moderator
Posts: 2272
Joined: Sat Jul 05, 2003 1:18 pm
Location: A bunk in the back
Contact:

Postby swirlee » Wed Jul 16, 2003 5:25 am

test RESULTS ARE AS FOLLOWING...

Your Connection speed is 103566.09167077 bytes per second
Your Connection Speed is 101.13876139724 kiloBYTES per second
Your Connection Speed is 809.11009117792 kiloBITS per second (this is what your modem is measured in)
A 1 megabyte download would take 10.145 seconds


Nice. I might suggest, though, that you trim off a few of the decimal points..

nathanwebb6
New php-forum User
New php-forum User
Posts: 27
Joined: Sat Jul 05, 2003 5:08 pm
Location: england uk
Contact:

Postby nathanwebb6 » Wed Jul 16, 2003 6:52 am

could do, but to how many decimals? 1 2 or 3

User avatar
swirlee
Moderator
Moderator
Posts: 2272
Joined: Sat Jul 05, 2003 1:18 pm
Location: A bunk in the back
Contact:

Postby swirlee » Wed Jul 16, 2003 7:05 am

If I were you, I'd limit bytes to one decimal and the others to three. Also, you might think about using number_format() to add commas to bigger numbers for readability.

nathanwebb6
New php-forum User
New php-forum User
Posts: 27
Joined: Sat Jul 05, 2003 5:08 pm
Location: england uk
Contact:

Postby nathanwebb6 » Wed Jul 16, 2003 12:48 pm

how do i use the round function to round a number to 1 or 3 decimal places?

User avatar
swirlee
Moderator
Moderator
Posts: 2272
Joined: Sat Jul 05, 2003 1:18 pm
Location: A bunk in the back
Contact:

Postby swirlee » Wed Jul 16, 2003 1:35 pm

nathanwebb6 wrote:how do i use the round function to round a number to 1 or 3 decimal places?


Try the documentation.


Return to “PHP Scripts”

Who is online

Users browsing this forum: allcapone1912 and 1 guest