Programming Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsOtherProgramming Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old November 11th, 2006, 04:32 PM
DBob DBob is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Oct 2005
Posts: 110 DBob User rank is Corporal (100 - 500 Reputation Level)DBob User rank is Corporal (100 - 500 Reputation Level)DBob User rank is Corporal (100 - 500 Reputation Level)DBob User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 21 h 35 m 56 sec
Reputation Power: 5
PHP HTTP_Accept_Language DIR?!

Hi

Can anyone suggest a PHP version of the following working ASP code which tests for the browsers language. Thanks
Or perhaps some online examples and resources??

Code:
Dim userLocale
Dim langname
userLocale = request.servervariables("HTTP_ACCEPT_LANGUAGE")
'Insert debug
Dim languages
languages = Split(userLocale, ",", -1)
Dim language
For Each language in languages
 If InStr(language, "en-GB") <> 0 Then
   response.redirect("http://www.site.com/otherlang)               
   response.End
   Else
   response.redirect("http://www.site.com")    
   End If
  Next

Reply With Quote
  #2  
Old November 13th, 2006, 02:31 AM
Shadow Wizard's Avatar
Shadow Wizard Shadow Wizard is offline
Moderator From Beyond
Click here for more information.
 
Join Date: Sep 2004
Location: Israel
Posts: 26,969 Shadow Wizard User rank is General 8th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 8th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 8th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 8th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 8th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 8th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 8th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 8th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 8th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 8th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 8th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 8th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 8th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 8th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 8th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 8th Grade (Above 100000 Reputation Level)  Folding Points: 342040 Folding Title: Super Ultimate Folder - Level 1Folding Points: 342040 Folding Title: Super Ultimate Folder - Level 1Folding Points: 342040 Folding Title: Super Ultimate Folder - Level 1Folding Points: 342040 Folding Title: Super Ultimate Folder - Level 1Folding Points: 342040 Folding Title: Super Ultimate Folder - Level 1Folding Points: 342040 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 3 Months 1 Week 5 Days 15 h 9 m 16 sec
Reputation Power: 1556
http://phplens.com/phpeverywhere/node/view/32
what you need is:
PHP Code:
Original - PHP Code
  1. $_SERVER["HTTP_ACCEPT_LANGUAGE"]

Reply With Quote
Reply

Viewing: ASP Free ForumsOtherProgramming Help > PHP HTTP_Accept_Language DIR?!


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway