Welcome Guest ( Log In | Register)



 
Reply to this topicStart new topic
> Redirect If Not Using Firefox
kobra500
post Apr 21 2008, 03:34 PM
Post #1


Super Member
*********

Group: [HOSTED]
Posts: 263
Joined: 8-January 08
From: UK - Kent
Member No.: 55,950



Basically i want a code to redirect people to a different page if they're using anything but firefox, there are codes for it but i cant find 1. If anyone can give me a hand it would be appreciated!!!
Go to the top of the page
 
+Quote Post
galexcd
post Apr 21 2008, 03:45 PM
Post #2


PROGRAMMER(prō'grăm'ər)- n. An organism that converts caffeine into software.
*********

Group: [HOSTED]
Posts: 920
Joined: 25-September 05
From: The dungeon deep below the foundation of trap17
Member No.: 12,251



You could do this in javascript, but then nothing would happen to people with javascript disabled. I believe the best solution for this is to use some php.
CODE
$redirect="http://www.redirecturlgoeshere.net";
if(preg_match('/Firefox/',$_SERVER['HTTP_USER_AGENT']))!=1) header("Location: ".$redirect);


But if the reason you want to do this is because IE or some other browser isn't supported you might want to think about allowing safari as well seeing as they render pages almost exactly alike.
Go to the top of the page
 
+Quote Post
kobra500
post Apr 21 2008, 04:41 PM
Post #3


Super Member
*********

Group: [HOSTED]
Posts: 263
Joined: 8-January 08
From: UK - Kent
Member No.: 55,950



QUOTE
Yeah bu safari is an apple program tongue.gif ... i dont want their kind visiting my site : D

teasing! - (quoted cos i dont deserve credits 4 it)


do i just replace the firefox bit with safari??
Go to the top of the page
 
+Quote Post
galexcd
post Apr 21 2008, 07:12 PM
Post #4


PROGRAMMER(prō'grăm'ər)- n. An organism that converts caffeine into software.
*********

Group: [HOSTED]
Posts: 920
Joined: 25-September 05
From: The dungeon deep below the foundation of trap17
Member No.: 12,251



If you want to include safari do this:

CODE
$redirect="http://www.redirecturlgoeshere.net";
if(preg_match(array('/Firefox/','/Safari/'),$_SERVER['HTTP_USER_AGENT']))!=1) header("Location: ".$redirect);
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic

Collapse

> Similar Topics

Topics Topics
  1. Faster Page Loading...(18)
  2. Make Firefox 4x Faster.(57)
  3. Did You Face Problem Opening Pdf With Firefox?(14)
  4. Firefox Hits The 50 Million Download Mark(32)
  5. New Rapidshare Hack For Firefox Users(19)
  6. Microsoft Employee's Use Firefox(23)
  7. Firefox Extensions Dream Package #1: Web Design Extensions(26)
  8. Firefox 2(48)
  9. Ie And Firefox Layout Differences(9)
  10. Microsoft Firefox(30)
  11. Firefox 3.0 Alpha6 Rc2 And Alpha7 Pre(5)
  12. Best Of Firefox Extension ?(16)
  13. Slow Mystery In Firefox Over Linux(1)
  14. Is There An Exploit In Vista Home Premium To Make Firefox Permanant Default Browser?(4)
  15. Http_redirect() [resolved](4)
  1. Opera, Firefox Bug Could Reveal Web Travels(0)
  2. 500 Million Firefox Downloads(7)
  3. Firefox Not Loading Java(1)
  4. Firefox 3 Sucks - Time For Another Browser(31)
  5. Mozilla Out With Firefox 3 Beta 4(1)
  6. Redirect Problem? [resolved](9)
  7. Firefox 3 Dream Package Updates(1)
  8. Firefox 3 - Lowest Memory Usage(11)
  9. Had You Tried Firefox 3 Beta 5?(12)
  10. Link Image Css Bug In Firefox(7)
  11. Firefox Feel(6)
  12. Hackers Focus Efforts On Firefox, Safari, And Office(1)
  13. Mozilla: Firefox Plugin Shipped With Malicious Code(2)


 



- Lo-Fi Version Time is now: 16th May 2008 - 07:55 PM