как да направия това

Kdo

Registered
искам някой скрипт
когато някой влезе в страницята ми примерно

www.kdo.bg - ако тои е с IE Да ги прехвълят в IE.PHP
А ако са с mozila да ги прехвърля в mozila.php
 
Код:
$uagent = getenv("HTTP_USER_AGENT");
if(strstr($uagent,"Firefox")) {
Stranicata za FF
}elseif(strstr($uagent,"MSIE")) {
Stranicata za IExplorer
}else{
Stranica za ostanalite browseri
}
 
BG_NIKE каза:
Код:
$uagent = getenv("HTTP_USER_AGENT");
if(strstr($uagent,"Firefox")) {
Stranicata za FF
}elseif(strstr($uagent,"MSIE")) {
Stranicata za IExplorer
}else{
Stranica za ostanalite browseri
}
Тоз код стана емблематичен.Тез хора непреглеждат ли форума!За тях няма ли търсачка? :wink:
 
като го направия така

Код:
<?php
$uagent = getenv("HTTP_USER_AGENT");
if(strstr($uagent,"Firefox")) {
http://localhost/u/index2.html/
}elseif(strstr($uagent,"MSIE")) {
http://localhost/u/index.html/
}else{
http://localhost/u/index.html/
}
?>

дава ми грешка


Parse error: syntax error, unexpected ':' in C:\xampp\htdocs\u\home.php on line 4
 
<?php
$uagent = getenv("HTTP_USER_AGENT");
if(strstr($uagent,"Firefox")) {
echo "http://localhost/u/index2.html";
}elseif(strstr($uagent,"MSIE")) {
echo "http://localhost/u/index.html";
}else{
echo "http://localhost/u/index.html";
}
?>
 
miro_94 каза:
<?php
$uagent = getenv("HTTP_USER_AGENT");
if(strstr($uagent,"Firefox")) {
echo "http://localhost/u/index2.html";
}elseif(strstr($uagent,"MSIE")) {
echo "http://localhost/u/index.html";
}else{
echo "http://localhost/u/index.html";
}
?>

излиза ми това

http://localhost/u/index2.html
аз искам да го прехвърля там
 
<?php
$uagent = getenv("HTTP_USER_AGENT");
if(strstr($uagent,"Firefox")) {
header("Location: http://localhost/u/index2.html");
}elseif(strstr($uagent,"MSIE")) {
header("Location: http://localhost/u/index.html");
}else{
header("Location: http://localhost/u/index.html");
}
?>
 
raiden каза:
<?php
$uagent = getenv("HTTP_USER_AGENT");
if(strstr($uagent,"Firefox")) {
header("Location: http://localhost/u/index2.html");
}elseif(strstr($uagent,"MSIE")) {
header("Location: http://localhost/u/index.html");
}else{
header("Location: http://localhost/u/index.html");
}
?>

Тенкс а как да направия ако някой иска да влезе в

http://localhost/u/index.html с мозила да го прехвърля в
http://localhost/u/index2.html
 
<?php
$uagent = getenv("HTTP_USER_AGENT");
if(strstr($uagent,"MSIE")) {
header("Location: http://localhost/u/index2.html");
}else{
//Останалата част от сайта
}
?>
 

Back
Горе