g m
09-02-2007, 04:25 AM
Hello ! every body .
i just finished my little tools that allow your users to access your web site in wap mode
i has checked all users browsers to view wap versions with mobile browsers .
. to redirect all users who visit your site with wap to wap virsion please add this code in index.php after
<?
add this
$wap="http://wap.yoursite.com"; // edit this to your wap direction
if (!empty($_SERVER['HTTP_USER_AGENT']))
{
$HTTP_USER_AGENT = $_SERVER['HTTP_USER_AGENT'];
}
else if (!empty($HTTP_SERVER_VARS['HTTP_USER_AGENT']))
{
$HTTP_USER_AGENT = $HTTP_SERVER_VARS['HTTP_USER_AGENT'];
}
else if (!isset($HTTP_USER_AGENT))
{
$HTTP_USER_AGENT = '';
}
if (ereg('Opera(/| )([0-9].[0-9]{1,2})', $HTTP_USER_AGENT, $log_version))
{
$browser_version = $log_version[2];
$browser_agent = 'opera';
}
else if (ereg('MSIE ([0-9].[0-9]{1,2})', $HTTP_USER_AGENT, $log_version))
{
$browser_version = $log_version[1];
$browser_agent = 'ie';
}
else if (ereg('OmniWeb/([0-9].[0-9]{1,2})', $HTTP_USER_AGENT, $log_version))
{
$browser_version = $log_version[1];
$browser_agent = 'omniweb';
}
else if (ereg('Netscape([0-9]{1})', $HTTP_USER_AGENT, $log_version))
{
$browser_version = $log_version[1];
$browser_agent = 'netscape';
}
else if (ereg('Mozilla/([0-9].[0-9]{1,2})', $HTTP_USER_AGENT, $log_version))
{
$browser_version = $log_version[1];
$browser_agent = 'mozilla';
}
else if (ereg('Konqueror/([0-9].[0-9]{1,2})', $HTTP_USER_AGENT, $log_version))
{
$browser_version = $log_version[1];
$browser_agent = 'konqueror';
}
else
{
$browser_version = 0;
$browser_agent = 'other';
}
if($browser_agent='other'){
print"<META HTTP-EQUIV='REFRESH' Content=0;URL='$wap'>";
}
please create sub domain it will be cool . name it "wap"
the link will be
http://wap.yoursite.com
and the open attach file and edit configurations
///confige
$allow="allow";/// this option to allow users who use pc to see your wap pages set blank will refresh to main url
include"../include/conf.php"; /// place the direction to this files
include"../include/config.php";
include"../include/db_conn.php";
/// let's print our wap data ..
then upload file to wap folder . and enjoy with your website with wap version ;) ..
/// gm
i just finished my little tools that allow your users to access your web site in wap mode
i has checked all users browsers to view wap versions with mobile browsers .
. to redirect all users who visit your site with wap to wap virsion please add this code in index.php after
<?
add this
$wap="http://wap.yoursite.com"; // edit this to your wap direction
if (!empty($_SERVER['HTTP_USER_AGENT']))
{
$HTTP_USER_AGENT = $_SERVER['HTTP_USER_AGENT'];
}
else if (!empty($HTTP_SERVER_VARS['HTTP_USER_AGENT']))
{
$HTTP_USER_AGENT = $HTTP_SERVER_VARS['HTTP_USER_AGENT'];
}
else if (!isset($HTTP_USER_AGENT))
{
$HTTP_USER_AGENT = '';
}
if (ereg('Opera(/| )([0-9].[0-9]{1,2})', $HTTP_USER_AGENT, $log_version))
{
$browser_version = $log_version[2];
$browser_agent = 'opera';
}
else if (ereg('MSIE ([0-9].[0-9]{1,2})', $HTTP_USER_AGENT, $log_version))
{
$browser_version = $log_version[1];
$browser_agent = 'ie';
}
else if (ereg('OmniWeb/([0-9].[0-9]{1,2})', $HTTP_USER_AGENT, $log_version))
{
$browser_version = $log_version[1];
$browser_agent = 'omniweb';
}
else if (ereg('Netscape([0-9]{1})', $HTTP_USER_AGENT, $log_version))
{
$browser_version = $log_version[1];
$browser_agent = 'netscape';
}
else if (ereg('Mozilla/([0-9].[0-9]{1,2})', $HTTP_USER_AGENT, $log_version))
{
$browser_version = $log_version[1];
$browser_agent = 'mozilla';
}
else if (ereg('Konqueror/([0-9].[0-9]{1,2})', $HTTP_USER_AGENT, $log_version))
{
$browser_version = $log_version[1];
$browser_agent = 'konqueror';
}
else
{
$browser_version = 0;
$browser_agent = 'other';
}
if($browser_agent='other'){
print"<META HTTP-EQUIV='REFRESH' Content=0;URL='$wap'>";
}
please create sub domain it will be cool . name it "wap"
the link will be
http://wap.yoursite.com
and the open attach file and edit configurations
///confige
$allow="allow";/// this option to allow users who use pc to see your wap pages set blank will refresh to main url
include"../include/conf.php"; /// place the direction to this files
include"../include/config.php";
include"../include/db_conn.php";
/// let's print our wap data ..
then upload file to wap folder . and enjoy with your website with wap version ;) ..
/// gm