Forums | MacLife

You are not logged in.

#1 2003-01-22 9:06 pm

zacwhite
Member
From: Norman, OK
Registered: 2001-04-19
Posts: 574
Website

Welcome Safari User!

Hehe, I decided that I need to give Safari a little plug on my site. So I made a "Welcome Safari user" tag that is there when the user is using safari. If you have a mac and aren't using safari, it gives you a link to go download it. And if you don't have a mac or aren't running macos you get a "Get a Mac" with a link to www.apple.com! Hehe. The code is below. It is done with PHP.

Code:

<?php
if (strstr($_SERVER["HTTP_USER_AGENT"], "Macintosh") || strstr($_SERVER["HTTP_USER_AGENT"], "Mac_PowerPC")){
    // OK, were on a mac
        // Are we using safari?
    if (strstr($_SERVER["HTTP_USER_AGENT"], "Apple")) { 
                // Yep!
        echo "<img src=images/safari.jpg>";
    } else {
                // nope
        echo "<a href=http://www.apple.com/safari/><img src=images/getsafari.jpg border=0></a>";
        }
} else {
        // Nope, On a PC
        echo "<a href=http://www.apple.com/><H3>Get a mac.</H3></a>";
}
?>

Check out the finished product at my site:
http://positron.frob.us/
HEHE smile


My Software Company
My WeBlog
My iTunes Version 4.0.0 Required

Offline

 

#2 2003-01-22 9:12 pm

mediocresau
Forum Default
From: Mediocre, Honolulu, HI
Registered: 2002-09-24
Posts: 3567
Website

Re: Welcome Safari User!

one word describes it: cooooool.   cool

Offline

 

#3 2003-01-22 9:22 pm

Tickle-Me-Eric
The Asthmatic Avenger
From: Hollywood, CA
Registered: 2000-06-12
Posts: 3452
Website

Re: Welcome Safari User!

Sweet, I was saying the Apple website should say, have you tried Safari? if you log on with a Mac and another Browser...


"Obviously they have mistaken me for a much shorter man"
- Cary Grant as Roger Thornhill, in North by NorthWest

"There's no emoticon for what I'm feeling!"

Offline

 

#4 2003-01-22 9:32 pm

mediocresau
Forum Default
From: Mediocre, Honolulu, HI
Registered: 2002-09-24
Posts: 3567
Website

Re: Welcome Safari User!

Sweet, I was saying the Apple website should say, have you tried Safari? if you log on with a Mac and another Browser...

dude, you should work for Apple.   big_smile

Offline

 

#5 2003-01-22 9:42 pm

cocoamix
Member
Registered: 2001-03-01
Posts: 7471

Re: Welcome Safari User!

cool


Jingoism - Extreme and emotional nationalism, or chauvinism, often characterized by an aggressive foreign policy, accompanied by an eagerness to wage war.

Offline

 

#6 2003-01-22 10:24 pm

panache
Member
From: Cape Cod, Mass
Registered: 2001-03-17
Posts: 2529
Website

Re: Welcome Safari User!

Dude, that's way cool.  I tried to copy and paste the code to my blog (after uploading the safari.jpg, of course, and pointing to it properly), but it won't display the graphic.  What have I done wrong?  I'm using Movable Type.  Thanks.  Way cool.


Visit my web log, <A HREF="http://www.dave.verybigdesign.com" TARGET=_blank>Kermit the Blog</A>

Offline

 

#7 2003-01-22 10:49 pm

zacwhite
Member
From: Norman, OK
Registered: 2001-04-19
Posts: 574
Website

Re: Welcome Safari User!

Well, it is php right? If so, I don't see the problem...You might have a permissions problem. Who does your web hosting?


My Software Company
My WeBlog
My iTunes Version 4.0.0 Required

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2005 Rickard Andersson