+ Reply to Thread
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 20

Thread: mobile phone only

  1. #1
    Senior Member brand is on a distinguished road
    Join Date
    May 2009
    Posts
    288
    Thanks
    23
    Thanked 7 Times in 6 Posts
    Rep Power
    2

    Default mobile phone only

    hi there every one

    can any one help me please i am after making my web/wap site just wap only and if some one trys to got to the site on a pc it shows a web site about the site and they can not get to the site from the web site hope ppl can understand what i am trying to say
    cheap sites for rent sites come with 24hrs help and support

    HELP THEM WHO HELPS YOU

  2. #2
    Member slayder
    Join Date
    Dec 2008
    Location
    belgium/bruselles/region 1000 bruselles/rue pond d`avenue/nr 13
    Posts
    54
    Thanks
    1
    Thanked 4 Times in 1 Post
    Rep Power
    0

    Wink

    PHP Code:
    <?php


    /*if (stristr($ua, "Windows CE") or stristr($ua, "AvantGo") or stristr($ua,"Mazingo") or stristr($ua, "Mobile") or stristr($ua, "T68")  or stristr($ua,"Syncalot") or stristr($ua, "Blazer") )
    {
        $DEVICE_TYPE="MOBILE";
    }

    if ($DEVICE_TYPE != "MOBILE")
        header ('Location: web/');
    else
        header ('Location: wap/');*/
        
        
    /*
    PHP to detect mobile phpnes
    http://www.andymoore.info/php-to-detect-mobile-phones/
    Last updated: 28th February 2009
    Version: 3.00

    Subscribe to my RSS feed to keep updated of changes to this script:
    http://andymoore.info/feed/

    Andy Moore - dotMobi Certified Mobile Web Developer
    http://www.andymoore.info/

    Need hosting or domain names?
    https://www.nostinghosting.com/

    Copyright 2008 Andy Moore (email : andy@andymoore.info)

    SHARED SOURCE LICENSE

    This License governs use of the accompanying Software, and your use of the Software constitutes acceptance of this license.

    You may use this Software for any non-commercial purpose, subject to the restrictions in this license. Some purposes which can be non-commercial are teaching, academic research, and personal experimentation. You may also distribute this Software with books or other teaching materials, or publish the Software on websites, that are intended to teach the use of the Software.

    You may not use or distribute this Software or any derivative works in any form for commercial purposes. Examples of commercial purposes would be running business operations, licensing, leasing, or selling the Software, or distributing the Software for use with commercial products.

    You may modify this Software and distribute the modified Software for non-commercial purposes, however, you may not grant rights to the Software or derivative works that are broader than those provided by this License. For example, you may not distribute modifications of the Software under terms that would permit commercial use, or under terms that purport to require the Software or derivative works to be sublicensed to others.

    You may use any information in intangible form that you remember after accessing the Software. However, this right does not grant you a license to any of Andy Moore's copyrights or patents for anything you might create using such information.

    In return, we simply require that you agree:

       1. Not to remove any copyright or other notices from the Software.

       2. That if you distribute the Software in any form, you will include a verbatim copy of this license.

       3. That if you distribute derivative works of the Software in source code form you do so only under a license that includes all of the provisions of this License, and if you distribute derivative works of the Software solely in object form you do so only under a license that complies with this License.

       4. That if you have modified the Software or created derivative works, and distribute such modifications or derivative works, you will cause the modified files to carry prominent notices so that recipients know that they are not receiving the original Software. Such notices must state: (i) that you have changed the Software; and (ii) the date of any changes.

       5. THAT THE SOFTWARE COMES "AS IS", WITH NO WARRANTIES. THIS MEANS NO EXPRESS, IMPLIED OR STATUTORY WARRANTY, INCLUDING WITHOUT LIMITATION, WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE OR ANY WARRANTY OF TITLE OR NON-INFRINGEMENT. ALSO, YOU MUST PASS THIS DISCLAIMER ON WHENEVER YOU DISTRIBUTE THE SOFTWARE OR DERIVATIVE WORKS.

       6. THAT ANDY MOORE WILL NOT BE LIABLE FOR ANY DAMAGES RELATED TO THE SOFTWARE OR THIS LICENSE, INCLUDING DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL OR INCIDENTAL DAMAGES, TO THE MAXIMUM EXTENT THE LAW PERMITS, NO MATTER WHAT LEGAL THEORY IT IS BASED ON. ALSO, YOU MUST PASS THIS LIMITATION OF LIABILITY ON WHENEVER YOU DISTRIBUTE THE SOFTWARE OR DERIVATIVE WORKS.

       7. That if you sue anyone over patents that you think may apply to the Software or anyone's use of the Software, your license to the Software ends automatically.

       8. That your rights under the License end automatically if you breach it in any way.

       9. Andy Moore reserves all rights not expressly granted to you in this license.

    */

    function detect_mobile_device(){
      
      
    // check if the user agent value claims to be windows but not windows mobile
      
    if(stristr($_SERVER['HTTP_USER_AGENT'],'windows')&&!stristr($_SERVER['HTTP_USER_AGENT'],'windows ce')){
        return 
    false;
      }
      
    // check if the user agent gives away any tell tale signs it's a mobile browser
      
    if(eregi('up.browser|up.link|windows ce|iemobile|mini|mmp|symbian|midp|wap|phone|pocket|mobile|pda|psp',$_SERVER['HTTP_USER_AGENT'])){
        return 
    true;
      }
      
    // check the http accept header to see if wap.wml or wap.xhtml support is claimed
      
    if(stristr($_SERVER['HTTP_ACCEPT'],'text/vnd.wap.wml')||stristr($_SERVER['HTTP_ACCEPT'],'application/vnd.wap.xhtml+xml')){
        return 
    true;
      }
      
    // check if there are any tell tales signs it's a mobile device from the _server headers
      
    if(isset($_SERVER['HTTP_X_WAP_PROFILE'])||isset($_SERVER['HTTP_PROFILE'])||isset($_SERVER['X-OperaMini-Features'])||isset($_SERVER['UA-pixels'])){
        return 
    true;
      }
      
    // build an array with the first four characters from the most common mobile user agents
      
    $a = array(
                        
    'acs-'=>'acs-',
                        
    'alav'=>'alav',
                        
    'alca'=>'alca',
                        
    'amoi'=>'amoi',
                        
    'audi'=>'audi',
                        
    'aste'=>'aste',
                        
    'avan'=>'avan',
                        
    'benq'=>'benq',
                        
    'bird'=>'bird',
                        
    'blac'=>'blac',
                        
    'blaz'=>'blaz',
                        
    'brew'=>'brew',
                        
    'cell'=>'cell',
                        
    'cldc'=>'cldc',
                        
    'cmd-'=>'cmd-',
                        
    'dang'=>'dang',
                        
    'doco'=>'doco',
                        
    'eric'=>'eric',
                        
    'hipt'=>'hipt',
                        
    'inno'=>'inno',
                        
    'ipaq'=>'ipaq',
                        
    'java'=>'java',
                        
    'jigs'=>'jigs',
                        
    'kddi'=>'kddi',
                        
    'keji'=>'keji',
                        
    'leno'=>'leno',
                        
    'lg-c'=>'lg-c',
                        
    'lg-d'=>'lg-d',
                        
    'lg-g'=>'lg-g',
                        
    'lge-'=>'lge-',
                        
    'maui'=>'maui',
                        
    'maxo'=>'maxo',
                        
    'midp'=>'midp',
                        
    'mits'=>'mits',
                        
    'mmef'=>'mmef',
                        
    'mobi'=>'mobi',
                        
    'mot-'=>'mot-',
                        
    'moto'=>'moto',
                        
    'mwbp'=>'mwbp',
                        
    'nec-'=>'nec-',
                        
    'newt'=>'newt',
                        
    'noki'=>'noki',
                        
    'opwv'=>'opwv',
                        
    'palm'=>'palm',
                        
    'pana'=>'pana',
                        
    'pant'=>'pant',
                        
    'pdxg'=>'pdxg',
                        
    'phil'=>'phil',
                        
    'play'=>'play',
                        
    'pluc'=>'pluc',
                        
    'port'=>'port',
                        
    'prox'=>'prox',
                        
    'qtek'=>'qtek',
                        
    'qwap'=>'qwap',
                        
    'sage'=>'sage',
                        
    'sams'=>'sams',
                        
    'sany'=>'sany',
                        
    'sch-'=>'sch-',
                        
    'sec-'=>'sec-',
                        
    'send'=>'send',
                        
    'seri'=>'seri',
                        
    'sgh-'=>'sgh-',
                        
    'shar'=>'shar',
                        
    'sie-'=>'sie-',
                        
    'siem'=>'siem',
                        
    'smal'=>'smal',
                        
    'smar'=>'smar',
                        
    'sony'=>'sony',
                        
    'sph-'=>'sph-',
                        
    'symb'=>'symb',
                        
    't-mo'=>'t-mo',
                        
    'teli'=>'teli',
                        
    'tim-'=>'tim-',
                        
    'tosh'=>'tosh',
                        
    'treo'=>'treo',
                        
    'tsm-'=>'tsm-',
                        
    'upg1'=>'upg1',
                        
    'upsi'=>'upsi',
                        
    'vk-v'=>'vk-v',
                        
    'voda'=>'voda',
                        
    'wap-'=>'wap-',
                        
    'wapa'=>'wapa',
                        
    'wapi'=>'wapi',
                        
    'wapp'=>'wapp',
                        
    'wapr'=>'wapr',
                        
    'webc'=>'webc',
                        
    'winw'=>'winw',
                        
    'winw'=>'winw',
                        
    'xda-'=>'xda-'
                      
    );
      
    // check if the first four characters of the current user agent are set as a key in the array
      
    if(isset($a[substr($_SERVER['HTTP_USER_AGENT'],0,4)])){
        return 
    true;
      }
    }

    if (
    detect_mobile_device()){

    if (isset(
    $_GET['pr'])&&is_numeric($_GET['pr'])){
        
    $lx "wap/?pr={$_GET['pr']}";
        
    header("Location: $lx");
    }else{
    $lx "wap/index.php";
        
            
    header("Location: $lx");
    }

    }else{
    if (isset(
    $_GET['pr'])&&is_numeric($_GET['pr'])){
        
    $lx "web/?pr={$_GET['pr']}";
        
    header("Location: $lx");
    }else{
    $lx "web/index.php";
        
    header("Location: $lx");
    }
    }

    ?>





  3. #3
    Senior Member brand is on a distinguished road
    Join Date
    May 2009
    Posts
    288
    Thanks
    23
    Thanked 7 Times in 6 Posts
    Rep Power
    2

    Default

    this will work on wapdesire v_2 script if so where do i add it please
    cheap sites for rent sites come with 24hrs help and support

    HELP THEM WHO HELPS YOU

  4. #4
    Senior Member nclemale36
    Join Date
    May 2007
    Location
    newcastle
    Posts
    435
    Thanks
    6
    Thanked 13 Times in 6 Posts
    Rep Power
    0

    Default

    easy as pie. use the original wapdesire browser redirct index.php make a web folder with an index in it and in that index put in you need a wml browser to enter this site . then put the real site in the wap folder .

    cant believe u didnt think of that.




  5. #5
    Member slayder
    Join Date
    Dec 2008
    Location
    belgium/bruselles/region 1000 bruselles/rue pond d`avenue/nr 13
    Posts
    54
    Thanks
    1
    Thanked 4 Times in 1 Post
    Rep Power
    0

    Default

    this will work on wich script you want if you have web chat into folder web and wap in folder wap easy as pie like nclemale36





  6. #6
    Senior Member huwad is on a distinguished road huwad's Avatar
    Join Date
    Apr 2009
    Posts
    248
    Thanks
    4
    Thanked 59 Times in 10 Posts
    Rep Power
    2

    Thumbs up

    Quote Originally Posted by brand
    hi there every one

    can any one help me please i am after making my web/wap site just wap only and if some one trys to got to the site on a pc it shows a web site about the site and they can not get to the site from the web site hope ppl can understand what i am trying to say
    ehehe.. add this in the header of your php file.. and it will work 100%

    Code:
    $huwad = "web"; // location of your web based site you can change it, ex. you have http://sitename.com/v2 you can replace that to v2
    
    $bwrs = $_SERVER['HTTP_USER_AGENT']; // detects user agent
    
    if (eregi("window", $bwrs)) { // the word window represents the keyword in the browser to detect and will redirect to web based if that browser detected
    header( "Location: $huwad" ) ; 
    }
    if (eregi("mac", $bwrs)) { // the word mac represents the keyword in the browser to detect and will redirect to web based if that browser detected
    header( "Location: $huwad" ) ;
    }
    if (eregi("microsoft", $bwrs)) { // the word microsoft represents the keyword in the browser to detect and will redirect to web based if that browser detected
    header( "Location: $huwad" ) ;
    }
    
    // you can add and remove user agent(browser) in the list just add and remove the code below
    //
    //
    // if (eregi("browserkeywordhere", $bwrs)) {
    // header( "Location: $huwad" ) ;
    // }
    //
    
    example this is your index.php

    PHP Code:

    <?php
    $huwad 
    "web";

    $bwrs $_SERVER['HTTP_USER_AGENT'];

    if (
    eregi("window"$bwrs)) {
    header"Location: $huwad" ) ;  

    if (
    eregi("mac"$bwrs)) {
    header"Location: $huwad" ) ; 

    if (
    eregi("microsoft"$bwrs)) {
    header"Location: $huwad" ) ; 
    }
    // INCLUDES AND HEADERS HERE
    include("config.php");
    include(
    "core.php");

    // SITE CONTENT HERE

    echo "SITE CONTENT";

    ?>

    OR

    PHP Code:

    <?php
    $huwad 
    "web"// web directory
    $huwadwap "wap"// wap directory

    $bwrs $_SERVER['HTTP_USER_AGENT'];

    // DEFINES PC USERS

    if (eregi("window"$bwrs)) {
    header"Location: $huwad" ) ;  

    if (
    eregi("mac"$bwrs)) {
    header"Location: $huwad" ) ; 

    if (
    eregi("microsoft"$bwrs)) {
    header"Location: $huwad" ) ; 
    }

    // DEFINES MOBILE USERS

    if (eregi("nokia"$bwrs)) {
    header"Location: $huwadwap" ) ; 
    }
    if (
    eregi("CLDC"$bwrs)) {
    header"Location: $huwadwap" ) ; 
    }
    if (
    eregi("phone"$bwrs)) {
    header"Location: $huwadwap" ) ; 
    }
    if (
    eregi("symbian"$bwrs)) {
    header"Location: $huwadwap" ) ; 
    }
    ///// BROWSER DETECT ENDS HERE /////

    // INCLUDES AND HEADERS HERE
    include("config.php");
    include(
    "core.php");

    // SITE CONTENT HERE

    echo "SITE CONTENT";

    ?>
    Last edited by huwad; 03-02-10 at 04:19.

    hacking is like sex. you get in, you get out and you pray you left nothing behind.

  7. #7
    Super Moderator metulj metulj's Avatar
    Join Date
    Jan 2007
    Location
    your root... now think fast... =]
    Posts
    1,066
    Thanks
    96
    Thanked 35 Times in 26 Posts
    Rep Power
    0

    Question

    can you really prevent/block web browser to access wap site ?

    XHTML, PHP, MySQL, CSS & more


  8. #8
    Senior Member kiss
    Join Date
    Jan 2006
    Location
    Bucharest
    Posts
    219
    Thanks
    1
    Thanked 31 Times in 5 Posts
    Rep Power
    0

    Lightbulb

    Quote Originally Posted by metulj
    can you really prevent/block web browser to access wap site ?
    Yes i do and it so simple, i use it in my
    PHP Code:
    <html>
    <
    body>
    $sql = @mysql_fetch_array(mysql_query("SELECT block FROM database_test"));
    if(
    $sql[0]==0)
    {
    if((
    strpos($agent"Msie") !== false) || (strpos($agent"Opera") !== false) || (strpos($agent"Emulator") !== false) || (strpos($agent"Winwap") !== false) || (strpos($agent"Wapsilon") !== false) || (strpos($agent"Safari") !== false) || (strpos($agent"Gecko") !== false) || (strpos($agent"Tagtag") !== false) || (strpos ($agent"Mozilla") !== false) || (strpos ($agent"Netscape") !== false) || (strpos ($agent"Google") !== false) || (strpos ($agent"Yahoo!") !== false) || (strpos ($agent"http://Anonymouse.org/") !== false))
    {
    echo 
    "<center>\n";
    echo 
    "<font color=\"red\">\n";
    echo 
    "Error,please visit page with a mobile browser\n";
    echo 
    "</font>\n";
    echo 
    "</center>\n";
    echo 
    "</body>\n";
    echo 
    "</html>\n";
    exit();
    }
    }
    </
    body>
    <
    html
    Last edited by metulj; 04-02-10 at 07:34.
    - the largest collection of mobile friendly web, seo and mobile utilities.

  9. #9
    Super Moderator metulj metulj's Avatar
    Join Date
    Jan 2007
    Location
    your root... now think fast... =]
    Posts
    1,066
    Thanks
    96
    Thanked 35 Times in 26 Posts
    Rep Power
    0

    Default

    Quote Originally Posted by kiss
    Yes i do and it so simple, i use it in my
    PHP Code:
    <html>
    <
    body>
    $sql = @mysql_fetch_array(mysql_query("SELECT block FROM database_test"));
    if(
    $sql[0]==0)
    {
    if((
    strpos($agent"Msie") !== false) || (strpos($agent"Opera") !== false) || (strpos($agent"Emulator") !== false) || (strpos($agent"Winwap") !== false) || (strpos($agent"Wapsilon") !== false) || (strpos($agent"Safari") !== false) || (strpos($agent"Gecko") !== false) || (strpos($agent"Tagtag") !== false) || (strpos ($agent"Mozilla") !== false) || (strpos ($agent"Netscape") !== false) || (strpos ($agent"Google") !== false) || (strpos ($agent"Yahoo!") !== false) || (strpos ($agent"http://Anonymouse.org/") !== false))
    {
    echo 
    "<center>\n";
    echo 
    "<font color=\"red\">\n";
    echo 
    "Error,please visit page with a mobile browser\n";
    echo 
    "</font>\n";
    echo 
    "</center>\n";
    echo 
    "</body>\n";
    echo 
    "</html>\n";
    exit();
    }
    }
    </
    body>
    <
    html
    if you use it on posted link...
    then how did i post with firefox without any problem ??
    can i see some better/working demo or example
    where you got blocked web browsers please ?
    Last edited by metulj; 04-02-10 at 07:40.

    XHTML, PHP, MySQL, CSS & more


  10. #10
    Senior Member kiss
    Join Date
    Jan 2006
    Location
    Bucharest
    Posts
    219
    Thanks
    1
    Thanked 31 Times in 5 Posts
    Rep Power
    0

    Default

    Of course,here an example of a user:
    - the largest collection of mobile friendly web, seo and mobile utilities.

+ Reply to Thread
Page 1 of 2 1 2 LastLast

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Similar Threads

  1. Replies: 10
    Last Post: 26-01-10, 14:07
  2. Replies: 11
    Last Post: 05-10-09, 02:54
  3. Replies: 3
    Last Post: 13-07-07, 19:45
  4. Whats the best apps for a s60 mobile phone?
    By Ghetto in forum Mobile Phones / Phone News
    Replies: 2
    Last Post: 17-09-05, 09:52
  5. Whats the best apps for a s60 mobile phone?
    By Ghetto in forum Mobile Phones / Phone News
    Replies: 0
    Last Post: 19-06-05, 13:43

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

SEO by vBSEO