473,881 Members | 1,718 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Detect connection speed

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

Jul 17 '05
13 7455
You can always use smaller image but the problem is that if the image
is too small, you won't get enough diffference, and if it is too large
(and 100kb IS) then the user will walk away to other URL... This is not
an efficient way of doing it. As far as I know there is no efficent
way. I just prvided posible solution that I have never used...

Or to put it another way, I posted this so we could brain storm my idea
and help someone along the way :) This code was never tested and should
never be put on the web in a copy-paste fashion. Use your had and then
use this code :)

Anyway, you can always put "Testing your newtwork speed... Please wait"
:-)

- Evanescent Lurker -

Jul 17 '05 #11
ev************* **@gmail.com (ev************ ***@gmail.com) wrote:
: You can always use smaller image but the problem is that if the image
: is too small, you won't get enough diffference, and if it is too large
: (and 100kb IS) then the user will walk away to other URL... This is not
: an efficient way of doing it. As far as I know there is no efficent
: way. I just prvided posible solution that I have never used...

: Or to put it another way, I posted this so we could brain storm my idea
: and help someone along the way :) This code was never tested and should
: never be put on the web in a copy-paste fashion. Use your had and then
: use this code :)

: Anyway, you can always put "Testing your newtwork speed... Please wait"
: :-)

The microsoft client update software that runs on lans (can't think what
it's called right now) uses a similar test before deciding how best to
proceded.

If you had a specific client base where most people are normally connected
at high speed then your idea could be a good kludge to use before trying
to do something like send large documents, or etc. so like I said, I'm not
trying to put the idea down at all.

--

This space not for rent.
Jul 17 '05 #12
It should be possible, I think, to accomplish the same thing without
using javascript ( but with still using a redirecting "testing
connection speed" gateway page ).

If, at the top of your php script, you were to store the current
microtime into a session variable...Then output several kilobytes of
random characters inside an HTML comment...Final ly output a <meta
HTTP-EQUIV='Refresh' Content='0; Url=target_page .php;'> tag. Then on
the target_page.php you could read the microtime again and compare it
to what you stored in the session.

-Ramius

p.s. - The reasoning for the random characters instead of just
whitespace is because it should hopefully slow the modem down more (
less compressible ). Also, beware that if your webserver is gzip'ing
your output, this will skew your results!
ev************* **@gmail.com wrote:
Hi there,

Have you thought of javascript?


Jul 17 '05 #13
>
p.s. - The reasoning for the random characters instead of just
whitespace is because it should hopefully slow the modem down more (
less compressible ). Also, beware that if your webserver is gzip'ing
your output, this will skew your results!


Yeah, and make sure that the function returning the random string is
faster than the connection. ;)

Cheers
Mike
Jul 17 '05 #14

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

13
23094
by: Yang Li Ke | last post by:
Hi guys, Is it possible to know the internet speed of the visitors with php? Thanx -- Yang
5
3322
by: chris | last post by:
hi all, is there a way that a script can detect the connection speed of a visitor, so that I can direct slower connection to a standard site and faster DSL/cable users to a flash copy of the site etc. thanks in advance
12
2641
by: Alban Hertroys | last post by:
Good day, I have a number of threads doing inserts in a table, after which I want to do a select. This means that it will occur that the row that I want to select is locked (by the DB). In these cases, I believe I receive an OperationalError (or is it an InterfaceError?). Is it possible (and if so - how?) to verify that the exception occured because of row locking, so that I can wait and try again?
1
3363
by: ripken95 | last post by:
I connect to the internet through ADSL. I want to write the web page which can detect the connection status with javascript. This detection is like the signal detection in the mobile phone. If the signal is weak, the status may have one squares or zero on the phone. How could I do if I want to detect the status of the network? Thx and Best Regards.
32
4300
by: Victor | last post by:
I've been to a few websites where it displays the town, state (if USA), country I'm browsing from. Now, I know that detecting country is easy, but how do you determine the town? What ASP components do this? Thanks, Bill.
4
3857
by: Frank Meng | last post by:
Hi. I am trying a csharp sample from http://www.codeproject.com/csharp/socketsincs.asp . (Sorry I didn't post all the source codes here, please get the codes from above link if you want to try). I had some troubles when I started 6 threads (each thread made a separate connection) and sent messages to same server simultaneously. Sometimes, not always, the socket looks like ok, but really it is dead. I don't why it happens.
13
2440
by: Shailesh Humbad | last post by:
Here is an advanced PHP question. Can anyone think of a way to detect the number of bytes written to output when a script is aborted? I am sending a large file to the client, and I want to record how many bytes are actually sent. I can detect abort of the script using a shutdown handler. In the shutdown handler, I tried ob_get_length, but it returns false. I tried to read the server's log file, but it is does not contain the...
0
1399
by: Arthur | last post by:
Hi, I am trying to write a windows service in VC++.NET 2003, the task of this server is to detect the kind of internet connection and if there is a connection send some file and do something. I have found a method calls InternetGetConnectedState() in .net, this returns false or true for connection also this one has flags and you can use them to know what kind of connection machine uses. But here is my problem: suppose you don't have...
1
1847
by: Arielle | last post by:
I wasn't sure where to put this but anyway here's the idea and I'm wondering if it's possible. Help would be appreciated but if anyone has done this before regardless I can eventually figure it out I just don't want to waste effort on the impossible. I want to basically detect a visitor's connection speed when they come to my website in order to determine which "version" to forward them to. I have one that is a little media intense...
0
9928
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9776
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
11100
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10718
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9554
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
7110
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5781
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5977
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
3225
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.