检测连接速度 [英] Detect connection speed

查看:46
本文介绍了检测连接速度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Usenet,


我目前在我的网站上工作,需要检测客户端的

连接速度。我想用PHP做这个,而不是

使用任何其他语言。这使它更复杂一些。我知道

它可以在PHP中完成,但我不能想到如何。


我需要弄清楚的是,如果它们是拨号或不拨号。它并不是b $ b必须100%准确但至少50%准确。任何帮助都非常值得赞赏。


Jordan

解决方案

< blockquote>文章< 11 ********************** @ f14g2000cwb.googlegroups .com>,
Jo ********* @ gmail.com 写道:

我目前正在工作在我的网站上,我需要检测客户端的连接速度。我想用PHP做到这一点,而不是使用任何其他语言。这使它更复杂一些。我知道
用PHP做这件事是可行的,但是我无法想到如何。

我需要弄清楚的是他们是否在拨号上。它不必100%准确但至少50%准确。任何帮助都非常感激。




除非您设置某种客户端/服务器程序,客户端可以下载
到客户端浏览器,运行它连接到

服务器的地方,然后断开连接,我没有看到用PHP做这个的方法。 Java,

是的。但不是PHP。


-

DeeDee,不要按那个按钮!迪迪!没有! Dee ...


如果它不必100%准确,为什么不问用户是否

他们是通过宽带还是拨号?

Jo ******** *@gmail.com 在新闻中写道:1112656179.236197.282160

@ f14g2000cwb.googlegroups.com:

Usenet,
<我目前在我的网站上工作,需要检测客户端的连接速度。我想用PHP做到这一点,而不是使用任何其他语言。这使它更复杂一些。我知道
用PHP做这件事是可行的,但是我无法想到如何。

我需要弄清楚的是他们是否在拨号上。它不必100%准确但至少50%准确。任何帮助都非常感激。

Jordan




你好,


您是否想过javascript?


< script type =" text / javascript">

counter = 0;

modemNeedsThisManyMiliseconds = 700;


tempImageOf100Kbs = new Image();

tempImageOf100Kbs.onload = function() {window.clearInterval(

milisecondCounter); (counter< modemNeedsThisManyMiliseconds)?

window.location.href =" broadband.html" :window.location.href =

" modem.html"}

milisecondCounter = window.setInterval(" counter ++",1);

tempImageOf100Kbs.src =" http://www.yoursite.com/image.jpg" ;;

< / script>


长线完成所有工作,除了看起来很难看之外它还可以工作。

当然你需要弄清楚

modemNeedsThisManyMiliseconds变量的值。 ..


另外你可能需要在图像中添加一些变量字符串

(image.jpg?code = kdmkdfmsfsd)这样浏览器就不会了使用缓存!


我希望我给你一个解决你的问题的提示...


- 渐渐潜伏 -


Usenet,

I am currently working on my website and am needing to detect the
connection speed of the client. I would like to do this in PHP and not
use any other languages. This makes it a bit more complicated. I know
it is possiable to do this in PHP but I can''t think of how.

All I need to figure out is if they are on dial up or not. It doesn''t
have to be 100% accurate but at least 50% accurate. Any help is greatly
appreciated.

Jordan

解决方案

In article <11**********************@f14g2000cwb.googlegroups .com>,
Jo*********@gmail.com wrote:

I am currently working on my website and am needing to detect the
connection speed of the client. I would like to do this in PHP and not
use any other languages. This makes it a bit more complicated. I know
it is possiable to do this in PHP but I can''t think of how.

All I need to figure out is if they are on dial up or not. It doesn''t
have to be 100% accurate but at least 50% accurate. Any help is greatly
appreciated.



Unless you setup some sort of client/server program where the client can
be downloaded to the client browser, run where it connects to the
server, then disconnects, I don''t see a way to do this with PHP. Java,
yes. But not PHP.

--
DeeDee, don''t press that button! DeeDee! NO! Dee...


If it doesn''t have to be 100% accurate, why not just ask the user if
they''re on broadband or dialup?

Jo*********@gmail.com wrote in news:1112656179.236197.282160
@f14g2000cwb.googlegroups.com:

Usenet,

I am currently working on my website and am needing to detect the
connection speed of the client. I would like to do this in PHP and not
use any other languages. This makes it a bit more complicated. I know
it is possiable to do this in PHP but I can''t think of how.

All I need to figure out is if they are on dial up or not. It doesn''t
have to be 100% accurate but at least 50% accurate. Any help is greatly
appreciated.

Jordan




Hi there,

Have you thought of javascript?

<script type="text/javascript">
counter = 0;
modemNeedsThisManyMiliseconds = 700;

tempImageOf100Kbs = new Image();
tempImageOf100Kbs.onload = function() { window.clearInterval(
milisecondCounter ); ( counter < modemNeedsThisManyMiliseconds ) ?
window.location.href = "broadband.html" : window.location.href =
"modem.html"}
milisecondCounter = window.setInterval( "counter++", 1 );
tempImageOf100Kbs.src = "http://www.yoursite.com/image.jpg";
</script>

The long line does all the job, and apart from looking ugly it works.
Of course you''ll need to figure out the value of the
modemNeedsThisManyMiliseconds variable...

Also you may need to put some variable string in the image
(image.jpg?code=kdmkdfmsfsd) so that browser doesn''t use cache!

I hope I gave you a hint in solving your problems...

- Evanescent Lurker -


这篇关于检测连接速度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆