GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   Scripting Gurus! Help please! (https://gfy.com/showthread.php?t=204790)

Tala 12-04-2003 07:39 PM

Scripting Gurus! Help please!
 
I need a code of some sort that reads the user's browser and redirects the user to an area of the site made specifically for that type of browser.

Example: User A is using a desktop with Nutscrape and User B is using a Palm Pilot with a wireless browser. I need to redirect User B to a wireless area of my site.

Help!

Tala 12-04-2003 07:50 PM

BuMp

fuzebox 12-04-2003 08:35 PM

I can do this in PHP fairly easily.

(see sig)

swedguy 12-04-2003 08:41 PM

http://www.google.com/search?sourcei...direct+browser

swedguy 12-04-2003 08:42 PM

http://www.google.com/search?num=30&...P_USER_AGEN T

fuzebox 12-04-2003 08:42 PM

Own3d by emb.ed protection again! :1orglaugh

Doing this with java.script is a hack anyway.

icedemon 12-04-2003 09:58 PM

If the server is using Apache, you can just use Mod_Rewrite in a .htaccess file.

For example:
Code:

RewriteEngine on

RewriteCond %{HTTP_USER_AGENT}  ^Mozilla/3.*
RewriteRule ^foo\.html$        foo.NS.html          [L]

RewriteCond %{HTTP_USER_AGENT}  ^Lynx/.*        [OR]
RewriteCond %{HTTP_USER_AGENT}  ^Mozilla/[12].*
RewriteRule ^foo\.html$        foo.20.html          [L]

RewriteRule ^foo\.html$        foo.32.html          [L]


berg.the.red 12-04-2003 11:46 PM

maybe PHP Sniff

jwerd 12-05-2003 12:00 AM

For this particular answer, I am going to have to say http://www.php.net/manual/en/tutorial.useful.php :)

If you read that, you will get a grasp on what it is you are trying to do. Then after you find out what the browsers names are you'd do some code like
PHP Code:

if($_SERVER["HTTP_USER_AGENT"hahahaha "IE") {
  
// use some java code, redirect to designated page //
} else {
  
// go somewhere else... 

Hope that helps!

Volantt 12-05-2003 12:27 AM

Quote:

Originally posted by icedemon
If the server is using Apache, you can just use Mod_Rewrite in a .htaccess file.

For example:
Code:

RewriteEngine on

RewriteCond %{HTTP_USER_AGENT}  ^Mozilla/3.*
RewriteRule ^foo\.html$        foo.NS.html          [L]

RewriteCond %{HTTP_USER_AGENT}  ^Lynx/.*        [OR]
RewriteCond %{HTTP_USER_AGENT}  ^Mozilla/[12].*
RewriteRule ^foo\.html$        foo.20.html          [L]

RewriteRule ^foo\.html$        foo.32.html          [L]


Use the Apache Rewrite method, it is the most effective and less of a hassle. Write it and forget about it.

V

Tala 12-05-2003 12:29 AM

Thanks everyone! :)


All times are GMT -7. The time now is 07:14 AM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123