Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > Web site for Mac only

Web site for Mac only
Thread Tools
Senior User
Join Date: Nov 2003
Location: Middle of the street
Status: Offline
Reply With Quote
Jan 2, 2004, 11:06 AM
 
I wanted to create a site that is only accessible to people whom are using a mac (sort of like certain sections of the .mac that can not be accessed if you are not on a mac).

Is it possible in PHP or will I have to forego (sp?) this idea?
     
Mac Elite
Join Date: Dec 2001
Location: Atlanta, GA, USA
Status: Offline
Reply With Quote
Jan 2, 2004, 12:53 PM
 
Originally posted by insha:
I wanted to create a site that is only accessible to people whom are using a mac (sort of like certain sections of the .mac that can not be accessed if you are not on a mac).

Is it possible in PHP or will I have to forego (sp?) this idea?
You can try to limit the site by web browser user agent, but there's no guarantee that it won't be bypassed.
Mac Pro 2x 2.66 GHz Dual core, Apple TV 160GB, two Windows XP PCs
     
insha  (op)
Senior User
Join Date: Nov 2003
Location: Middle of the street
Status: Offline
Reply With Quote
Jan 2, 2004, 01:16 PM
 
Originally posted by Arkham_c:
You can try to limit the site by web browser user agent, but there's no guarantee that it won't be bypassed.
I had thought about doing this; but then I figured it would easy to bypass that check. There must be another (read better) way of doing this.

I wonder how Apple is doing it for .Mac?!?
     
Clinically Insane
Join Date: Nov 1999
Status: Offline
Reply With Quote
Jan 2, 2004, 06:24 PM
 
Originally posted by insha:
I had thought about doing this; but then I figured it would easy to bypass that check. There must be another (read better) way of doing this.

I wonder how Apple is doing it for .Mac?!?
There is no foolproof method. The closest thing you can really do is require that the user have JavaScript turned on, then check the platform using Navigator.platform() (or whatever it's called; I don't remember off the top of my head). Navigator.platform is harder to fake than the user-agent string.

Of course, if you do this, then you've started requiring JavaScript, and that will alienate some of your userbase. A fair number of people strongly dislike JavaScript even though they surf with it enabled. It's like Flash in that aspect.
You are in Soviet Russia. It is dark. Grue is likely to be eaten by YOU!
     
Mac Elite
Join Date: May 2001
Location: Melbourne, Australia
Status: Offline
Reply With Quote
Jan 3, 2004, 05:52 AM
 
May I ask why you want to do this?
     
Professional Poster
Join Date: Oct 2002
Location: Off the Tobakoff
Status: Offline
Reply With Quote
Jan 3, 2004, 03:18 PM
 
Originally posted by thePurpleGiant:
May I ask why you want to do this?
To fight The Man, of course.
"You rise," he said, "like Aurora."
     
Dedicated MacNNer
Join Date: Oct 2000
Location: Copenhagen, Denmark
Status: Offline
Reply With Quote
Jan 18, 2004, 01:06 PM
 
If you are using .php, you could look at http://www.php.net/function.get-browser and get ideas (at least it doesn't rely on javascript, but can still be fooled).

Peter
     
Occasionally Useful
Join Date: Jun 2001
Location: Liverpool, UK
Status: Offline
Reply With Quote
Jan 18, 2004, 04:09 PM
 
i have a Safari-only style sheet, which only loads when viewed with Safari. you could do something like that, i guess. [php]<style type="text/css" media="screen">
@import "css/style.css";
<?php
if (strpos($_SERVER["HTTP_USER_AGENT"], "Safari") !== false) {
echo " @import \"css/safari.css\";\n";
} ?>
</style>[/php]as stated above though, this probably isn't foolproof at all.
"Have sharp knives. Be creative. Cook to music" ~ maxelson
     
mdc
Addicted to MacNN
Join Date: Feb 2003
Location: NY²
Status: Offline
Reply With Quote
Jan 18, 2004, 04:20 PM
 
Code:
<script language="JavaScript"> page = ((navigator.platform.indexOf('Win') > -1) ? "windowspage.html" : "macpage.html"); window.location=page; </script>
little javascript that will redirect depending on what os is used.
     
Junior Member
Join Date: Sep 2000
Status: Offline
Reply With Quote
Jan 22, 2004, 06:03 AM
 
Originally posted by insha:
I wanted to create a site that is only accessible to people whom are using a mac (sort of like certain sections of the .mac that can not be accessed if you are not on a mac).

Is it possible in PHP or will I have to forego (sp?) this idea?
You could embed a very simple Java Applet that relies on Java 1.2, then examine the system properties of the Java VM to detect the host platform.

That would be very hard to forge.
Nobody made a greater mistake than
he who did nothing because he could only
do a little. Edmund Burke
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 02:36 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2