Board index   FAQ   Search  
Register  Login
Board index PHP PHP Scripts

how do i do the following??

Links for php scripts

Moderators: macek, egami, gesf

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??
nathanwebb6
New php-forum User
New php-forum User
 
Posts: 27
Joined: Sat Jul 05, 2003 5:08 pm
Location: england uk

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
User avatar
bezmond
Moderator
Moderator
 
Posts: 312
Joined: Sat Apr 05, 2003 4:33 am
Location: Mansfield, UK

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

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
nathanwebb6
New php-forum User
New php-forum User
 
Posts: 27
Joined: Sat Jul 05, 2003 5:08 pm
Location: england uk

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

I take it that worked? :)

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

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
User avatar
WiZARD
Moderator
Moderator
 
Posts: 1257
Joined: Thu Jun 20, 2002 10:14 pm
Location: Ukraine, Crimea, Simferopol

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

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!
nathanwebb6
New php-forum User
New php-forum User
 
Posts: 27
Joined: Sat Jul 05, 2003 5:08 pm
Location: england uk

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..
User avatar
swirlee
Moderator
Moderator
 
Posts: 2272
Joined: Sat Jul 05, 2003 1:18 pm
Location: A bunk in the back

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

could do, but to how many decimals? 1 2 or 3
nathanwebb6
New php-forum User
New php-forum User
 
Posts: 27
Joined: Sat Jul 05, 2003 5:08 pm
Location: england uk

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.
User avatar
swirlee
Moderator
Moderator
 
Posts: 2272
Joined: Sat Jul 05, 2003 1:18 pm
Location: A bunk in the back

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?
nathanwebb6
New php-forum User
New php-forum User
 
Posts: 27
Joined: Sat Jul 05, 2003 5:08 pm
Location: england uk

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.
User avatar
swirlee
Moderator
Moderator
 
Posts: 2272
Joined: Sat Jul 05, 2003 1:18 pm
Location: A bunk in the back


Return to PHP Scripts

Who is online

Users browsing this forum: Google [Bot] and 2 guests

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.