Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [php] rozpoznanie IE7
bastek8989
post
Post #1





Grupa: Zarejestrowani
Postów: 205
Pomógł: 1
Dołączył: 11.09.2006

Ostrzeżenie: (0%)
-----


Witam

Mam nast skrypt:

  1. <?
  2. $x = $_SERVER['HTTP_USER_AGENT'];
  3.  
  4. if(substr_count($x,"pera")!=0)
  5.  { $br = "Opera"; }
  6. else if(substr_count($x,"MSIE")!=0)
  7.  { $br = "Internet Explorer"; }
  8. else if(substr_count($x,"etscape6")!=0)
  9.  { $br = "Netscape 6"; }
  10. else if(substr_count($x,"rv:1.")!=0)
  11.  { $br = "Mozilla 1.x"; }
  12. else if(substr_count($x,"4.7")!=0)
  13.  { $br = "Netscape 4.7x"; }
  14. else
  15.  { $br = "inna"; }
  16.  
  17. echo "Twoja przegladarka to <b>$br</b>";
  18. ?>


Jak moge odroznic IE7 od poprzednich wersji tej przegladarki?

dzieki za pomoc
pozdrawiam
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi (1 - 3)
revyag
post
Post #2





Grupa: Przyjaciele php.pl
Postów: 2 258
Pomógł: 16
Dołączył: 21.09.2004
Skąd: Kielce

Ostrzeżenie: (0%)
-----


A np. tak (IMG:http://forum.php.pl/style_emoticons/default/smile.gif)
  1. <?php
  2. $us = getenv('HTTP_USER_AGENT');
  3. if (eregi("MSIE [7]",$us)) {
  4. echo 'siodemka';
  5. }
  6. ?>
Go to the top of the page
+Quote Post
bastek8989
post
Post #3





Grupa: Zarejestrowani
Postów: 205
Pomógł: 1
Dołączył: 11.09.2006

Ostrzeżenie: (0%)
-----


a jesli chcialbym uzyskac if'a ktory sie wykonuje dla wszystkich wersji starszych od IE 7? to jak to sklecic?
Go to the top of the page
+Quote Post
revyag
post
Post #4





Grupa: Przyjaciele php.pl
Postów: 2 258
Pomógł: 16
Dołączył: 21.09.2004
Skąd: Kielce

Ostrzeżenie: (0%)
-----


  1. <?php
  2. $us = getenv('HTTP_USER_AGENT');
  3. if (eregi("MSIE [4-6]",$us)) {
  4. //.....
  5. }
  6. ?>
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 23.08.2025 - 10:12