Previous Thread
Next Thread
Print Thread
Rate Thread
#225843 10/03/2002 5:38 PM
Joined: Apr 2002
Posts: 1,768
Addict
Addict
Offline
Joined: Apr 2002
Posts: 1,768
This is a standalone script which checks whether the user's browser supports various features used by UBB.threads, and displays the results.

The idea is that if a user if having a problem using UBB.threads, he can run this script to help isolate the problem.

The following client-side features are tested:
Cookies - Cookies can be set and read.
Referrer - The URL of the referring page can be read.
Javascript - Javascript within a web page can be executed.
Javascript read cookie - Cookies can be read using Javascript.
Javascript set cookie - Cookies can be set using Javascript.
Clock - The server and client clocks agree within a specified tolerance.

Feedback requested. <img src="/threads/php/images/graemlins/smile.gif" alt="" />

Please test this with different platforms/browsers, and with different browser security settings.

Edit: attachment updated to version 1.0.1 - made downward-compatible with PHP 4.0

Edit: attachment updated to version 1.1.0 - added Javascript cookie tests and clock test, and added a separate configuration file.[i]

[i]Edit: attachment updated to version 1.2.0 - split single referrer test into three tests, changed clock difference display to use appropriate time units, added a few parameters to configuration file.


Edit: attachment updated to version 1.2.1 - Fixed clock difference display to use appropriate time units for negative values.

Edit: attachment updated to version 1.3.0 - Added link to Infopop's Browser Problems article on test results page.

---------

Reposted here.

Last edited by Dave_L; 07/10/2003 6:05 PM.
Sponsored Links
joeuser #225844 10/03/2002 5:58 PM
Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
This sounds Really Cool!

Thanks Dave.

Is there anything I need to configure? I copied it into my threads directory, but when I visit the page, I get this error:

Warning: Undefined variable: _SERVER in /home/measurection/htdocs/forums/browser_check.php on line 41

Warning: Cannot add header information - headers already sent by (output started at /home/measurection/htdocs/forums/browser_check.php:41) in /home/measurection/htdocs/forums/browser_check.php on line 41

Daine #225845 10/03/2002 6:08 PM
Joined: Apr 2002
Posts: 1,768
Addict
Addict
Offline
Joined: Apr 2002
Posts: 1,768
What version of PHP are you running?

The variable $_SERVER is only implemented in PHP 4.1+. There's a note about that in the script. I wonder if I should make it downward-compatible with PHP 4.0.

joeuser #225846 10/03/2002 6:16 PM
Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
Ahhh.....

Just did a PHP Info and I've got 4.0.

Surprising tha I didn't read all the directions. LOL So unlike me.

Sorry.

Daine #225847 10/03/2002 6:23 PM
Joined: Apr 2002
Posts: 1,768
Addict
Addict
Offline
Joined: Apr 2002
Posts: 1,768
I'll go ahead and make the script compatibile with 4.0, since there are probably a lot of people still using that.

Sponsored Links
joeuser #225848 10/03/2002 6:30 PM
Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
I've never been one to upgrade "if it ain't broke".. but should I be running PHP 4.1.

I haven't fooled with any OS upgrades for fear of screwing something up that I don't undersstand... but I think Rackspace would do it for me if I filled out a ticket.

Is 4.1 a security fix?

Daine #225849 10/03/2002 6:33 PM
Joined: Apr 2002
Posts: 1,768
Addict
Addict
Offline
Joined: Apr 2002
Posts: 1,768
I'm in the same position, except that I'm using 4.1.2, and should probably upgrade to 4.2. I had so much trouble getting PHP and MySQL working on my server, though, that I'm scared to upgrade.

joeuser #225850 10/03/2002 7:30 PM
Joined: Mar 2000
Posts: 21,079
Likes: 3
I type Like navaho
I type Like navaho
Joined: Mar 2000
Posts: 21,079
Likes: 3
A good number of security fixes have been added since 4.0


- Allen wavey
- What Drives You?
Joined: Mar 2000
Posts: 21,079
Likes: 3
I type Like navaho
I type Like navaho
Joined: Mar 2000
Posts: 21,079
Likes: 3
we must have the same issues here:

https://www.ubbdev.com/threads/browser_check.php



- Allen wavey
- What Drives You?
Joined: Apr 2002
Posts: 1,768
Addict
Addict
Offline
Joined: Apr 2002
Posts: 1,768
It looks like you're running PHP 4.0.6 here. Is that correct? I thought you were more progressive than that.

Sponsored Links
Daine #225853 10/03/2002 7:55 PM
Joined: Apr 2002
Posts: 1,768
Addict
Addict
Offline
Joined: Apr 2002
Posts: 1,768
I've updated the attachment in the initial post, so the script should work on PHP 4.0. The new version is 1.0.1, and the timestamp on the PHP file is 2002-10-04 0032 GMT.

joeuser #225854 10/03/2002 8:04 PM
Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
That's really cool!

Thanks dave!

I'm adding this to my help forum at my site.

Thanks

joeuser #225855 10/03/2002 8:18 PM
Joined: Mar 2000
Posts: 21,079
Likes: 3
I type Like navaho
I type Like navaho
Joined: Mar 2000
Posts: 21,079
Likes: 3
This is infopop's server... we're just happy squatters

I'll upload your new script in a second


- Allen wavey
- What Drives You?
Joined: Mar 2000
Posts: 21,079
Likes: 3
I type Like navaho
I type Like navaho
Joined: Mar 2000
Posts: 21,079
Likes: 3
Cool, works well


- Allen wavey
- What Drives You?
joeuser #225857 10/03/2002 8:27 PM
Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
If anyone wants to see it in action, you can here.

Daine #225858 10/04/2002 4:15 PM
Joined: Apr 2001
Posts: 3,266
Member
Member
Offline
Joined: Apr 2001
Posts: 3,266
Okay mine does not pass the referer check what can I do?

Feature Description Test result
Cookies Client-side cookies can be set and read. PASSED
Referrer The URL of the referring page can be read. FAILED
Javascript Javascript within a web page can be executed. PASSED

sf49rminer #225859 10/04/2002 4:23 PM
Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
You probably need to adjust your firewall settings. See this document for more info. Usually it's Norton or Zone Alarm Pro.

Daine #225860 10/04/2002 7:01 PM
Joined: Apr 2001
Posts: 3,266
Member
Member
Offline
Joined: Apr 2001
Posts: 3,266
Actually my settings have been set correctly for a while. Now I have no problem with UBBthreads or anything. However that test does say I pass the referer check. Probally my cable modem cache but if thats the problem i would not see new content which I indeed do.

sf49rminer #225861 10/04/2002 7:13 PM
Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
Are you testing it on your site... or my site?

If it were mine you'd probably have to add www.measurection.com into the firewall settings.

I don't know much about how that works. Maybe Dave_L can explain more about if the test can fail if threads still works. I guess it does if the site has the refer check off.

Daine #225862 10/05/2002 11:23 AM
Joined: Jun 2001
Posts: 176
Member
Member
Offline
Joined: Jun 2001
Posts: 176
now an idea was born .
hey the browser check is good but if some stuff fails
then you should have a link to a howto fix
so a page needs to be made to point out firwall setting & stuff like that .

eh? what do you guy's think ?


interforos #225863 10/05/2002 11:55 AM
Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
Thats an Excellent Idea.

I think I'm going to "hack" mine to link to the How To poss I have on my site for fixing the firewall etc....

Thanks.

sf49rminer #225864 10/06/2002 5:11 PM
Joined: Apr 2002
Posts: 1,768
Addict
Addict
Offline
Joined: Apr 2002
Posts: 1,768
omegatron, is that test still failing for you?

joeuser #225865 10/06/2002 5:25 PM
Joined: Apr 2002
Posts: 1,768
Addict
Addict
Offline
Joined: Apr 2002
Posts: 1,768
Issues:

1) Currently, the test-cookie set by the script has an expiration date/time of five minutes from "now". I'm wondering if that could cause problems if the user's clock is off a bit. Or maybe if that does cause the test to fail, it means that the test script is doing what it should.

2) I'm also thinking of adding a test for server date/time vs. client date/time. I'm not sure how to do this, but maybe Javascript could be used to read the client's clock. If I can get this working, what "tolerance" do you think should be used to distinguish pass/fail?

3) I think I'm going to add some more info to the displayed results, to aid in diagnosing test failures.

Daine #225866 10/09/2002 5:42 PM
Joined: Apr 2002
Posts: 1,768
Addict
Addict
Offline
Joined: Apr 2002
Posts: 1,768
I just uploaded a new version (1.1.0) that has additional tests and a separate configuration file, which makes it easier to customize the displayed header and footer.

joeuser #225867 10/10/2002 3:56 PM
Joined: Apr 2001
Posts: 3,266
Member
Member
Offline
Joined: Apr 2001
Posts: 3,266
In the new version my referer also fails everything else passes.

sf49rminer #225868 10/10/2002 4:52 PM
Joined: Apr 2002
Posts: 1,768
Addict
Addict
Offline
Joined: Apr 2002
Posts: 1,768
1) Are you running the Browser Check script on the same server that your UBB.threads is on?

2) In your UBB.threads configuration settings, do you have "Do you want to disable the referer check?" set to (a) "No, always check referer" or (b) "Yes, disable this check." ?

joeuser #225869 10/10/2002 5:21 PM
Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
New Version is Cool Dave!

Daine #225870 10/10/2002 5:25 PM
Joined: Apr 2002
Posts: 1,768
Addict
Addict
Offline
Joined: Apr 2002
Posts: 1,768

joeuser #225871 10/10/2002 5:36 PM
Joined: Apr 2001
Posts: 3,266
Member
Member
Offline
Joined: Apr 2001
Posts: 3,266
Referer is no always preform check and my browser check script is run from the same server

sf49rminer #225872 10/10/2002 5:57 PM
Joined: Apr 2002
Posts: 1,768
Addict
Addict
Offline
Joined: Apr 2002
Posts: 1,768
Could you try this?

Edit browser_check.php and in function do_page3() at line 216, change:
code:
$results_display
$clock_comparison_display
<p><b>Click <a href='{$HTTP_SERVER_VARS['PHP_SELF']}'>HERE</a> to repeat the tests.</b>


to
code:
$results_display
$clock_comparison_display
[:"red"]<p>referrer='{$HTTP_SERVER_VARS['HTTP_REFERER']}'<br />
referrer_should_be='$referrer_should_be'</p>[/]
<p><b>Click <a href='{$HTTP_SERVER_VARS['PHP_SELF']}'>HERE</a> to repeat the tests.</b>



Then copy/paste the output here, or send it to me privately.

Thanks.

Last edited by Dave_L; 10/10/2002 6:01 PM.
sf49rminer #225873 10/10/2002 8:47 PM
Joined: Apr 2002
Posts: 1,768
Addict
Addict
Offline
Joined: Apr 2002
Posts: 1,768
Thanks, got your PM, the info was helpful.

It's interesting that on your server, the query string portion of HTTP_REFERER was not passed.

I guess I'll need to make the referrer test more flexible.

One question: When you're viewing the postlist for a specific board within your UBB.threads, or viewing a specific thread, and you click the Search link, does it default to searching that specific board? UBB.threads (6.1.1) seems to use the query string portion of HTTP_REFERER to figure out which board to search, so I would think that would fail.

Last edited by Dave_L; 10/10/2002 8:49 PM.
joeuser #225874 10/11/2002 5:05 AM
Joined: Apr 2001
Posts: 3,266
Member
Member
Offline
Joined: Apr 2001
Posts: 3,266
Nope not at all. When I click search it defaults to the forum I am viewing when viewing both a thread or postlist of the specific forum. Dave I gor your private message. I beleive I answered above. To be even more clear if I am in reefs and hit search I get reefs not all forums.

Last edited by omegatron; 10/11/2002 4:57 PM.
sf49rminer #225875 10/16/2002 7:46 AM
Joined: Apr 2002
Posts: 1,768
Addict
Addict
Offline
Joined: Apr 2002
Posts: 1,768
Sorry for not repliying earlier, I just noticed your reply.

Hmmmm .... I don't understand how the search can behave like that with the referrer test failing.

But I've updated the script to version 1.2.0, in which I've split the referrer test into three tests. In your case, I would expect the first two referrer tests to pass, and the third to fail. The third test can be disabled in the config file if desired.

joeuser #225876 11/13/2002 10:46 AM
Joined: Apr 2002
Posts: 1,768
Addict
Addict
Offline
Joined: Apr 2002
Posts: 1,768
Updated to version 1.2.1. This is basically just a cosmetic fix.

joeuser #225877 07/10/2003 6:21 PM
Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
Reposted here.


Link Copied to Clipboard
Donate Today!
Donate via PayPal

Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.

Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
Gizmo
Gizmo
Portland, OR, USA
Posts: 5,833
Joined: January 2000
Forum Statistics
Forums63
Topics37,573
Posts293,925
Members13,849
Most Online5,166
Sep 15th, 2019
Today's Statistics
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
Top Posters
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,833
Greg Hard 4,625
Top Posters(30 Days)
Top Likes Received
isaac 82
Gizmo 20
Brett 7
WebGuy 2
Morgan 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2024 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20221218)