Jump to content

Wap - Html Yönlendirme


Recommended Posts

html ile yapabileceğini sanmıyorum.php ya da asp ile olur.örnek php kodu buldum.
[code]$iphone = strpos($_SERVER['HTTP_USER_AGENT'],"iPhone");
$android = strpos($_SERVER['HTTP_USER_AGENT'],"Android");
$palmpre = strpos($_SERVER['HTTP_USER_AGENT'],"webOS");
$berry = strpos($_SERVER['HTTP_USER_AGENT'],"BlackBerry");
$ipod = strpos($_SERVER['HTTP_USER_AGENT'],"iPod");

if ($iphone || $android || $palmpre || $ipod || $berry == true)
{
header('Location: http://siteadresin.com/index.wml');
}
[/code]

Link to comment
Share on other sites

Hocam bu kodu index.php yapıp ana dizine atarsın:
[code]<?php
$iphone = strpos($_SERVER['HTTP_USER_AGENT'],"iPhone");
$android = strpos($_SERVER['HTTP_USER_AGENT'],"Android");
$palmpre = strpos($_SERVER['HTTP_USER_AGENT'],"webOS");
$berry = strpos($_SERVER['HTTP_USER_AGENT'],"BlackBerry");
$ipod = strpos($_SERVER['HTTP_USER_AGENT'],"iPod");

if ($iphone || $android || $palmpre || $ipod || $berry == true)
{
header('Location: wap.html');
}
else {
header('Location: web.html');
}
?>[/code]
ama burada önemli bir nokta var.index.php ile index.html yi anadizine atarsan ilk olarak index.html yi görür.o yüzden web.html yazdım.
Yukarıdaki kodlarda tarayıcı bilgilerine bakıyor ve içinde o kelimeler geçerse wap.html sayfasına, geçmezse web.html sayfasına yönlendiriyor.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...