Help In Redirecting Pc & Wap Users

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Help In Redirecting Pc & Wap Users

    Hi

    i use a XHTML wap site.

    and i hav a PC version of website separate.

    i dont want PC users to use my wap site.

    only thro Mobiles the WAP site should be browsed. other user should be redirected to the original PC version website...

    how do i do that ?

    any correct code available ?

    :sad:

    #2
    You can make one redirection for you script
    You can made in file caled redirect.php
    and put this code:
    <div class='codetop'>CODE</div><div class='codemain' style='height:200px;white-space:pre;overflow:auto'><?
    $browser = explode("",$HTTP_USER_AGENT);
    if($browser[0]=="Mozilla")
    {
    header (&#39;Location: http://www.google.ro/&#39;);
    exit;}
    if($browser[0]=="Net Scape")
    {
    header (&#39;Location: http://www.google.ro/&#39;);
    exit;}
    if($browser[0]=="MSIE")
    {
    header (&#39;Location: http://www.google.ro/&#39;);
    exit;}
    if($browser[0]=="Opera")
    {
    header (&#39;Location: http://www.google.ro/&#39;);
    exit;}
    if($browser[0]=="Safari")
    {
    header (&#39;Location: http://www.google.ro/&#39;);
    exit;}
    if($browser[0]=="http://Anonymouse.org")
    {
    header (&#39;Location: http://Anonymouse.org&#39;);
    exit;}
    ?></div>
    After that you can use include function eg:
    include("redirect.php");
    in all your files from script

    Because you script is in XHTML you can`t use ($HTTP_ACCEPT),"VND.WAP.WML") to accept only wap browsers
    and user can enter from some hide browsers
    For begin is good this code
    If you use $browser = explode("/ ",$HTTP_USER_AGENT); to show entire browser
    Modify in redirect.php corectly
    Also you can use this script to redirect any browser just put another lines like:

    if($browser[0]=="browser")
    {
    header (&#39;Location: http://www.some_site.com/&#39;);
    exit;}
    in redirect.php

    Comment


      #3
      Hi

      i use a XHTML wap site.

      and i hav a PC version of website separate.

      i dont want PC users to use my wap site.

      only thro Mobiles the WAP site should be browsed. other user should be redirected to the original PC version website...

      how do i do that ?

      any correct code available ?

      :sad:[/b]

      use as u need like change pc and mobile php in it as your own and call it index.php
      Code:
      <?
      $htmlredirect = "http://site.com/pc.php";
      $wmlredirect = "http://site.com/mobile.php";
      if(strpos(strtoupper($HTTP_ACCEPT),"VND.WAP.WML") > 0){
      header("Location: ".$wmlredirect);}
      else{
      header("Location: ".$htmlredirect);
      exit;}
      ?>
      left wap stuff

      Comment


        #4
        thx...

        let me try...

        Comment


          #5
          You can make one redirection for you script
          You can made in file caled redirect.php
          and put this code:
          <div class='codetop'>CODE
          <div class='codemain' style='height:200px;white-space:pre;overflow:auto'><?
          $browser = explode("",$HTTP_USER_AGENT);
          if($browser[0]=="Mozilla")
          {
          header (&#39;Location: http://www.google.ro/&#39;);
          exit;}
          if($browser[0]=="Net Scape")
          {
          header (&#39;Location: http://www.google.ro/&#39;);
          exit;}
          if($browser[0]=="MSIE")
          {
          header (&#39;Location: http://www.google.ro/&#39;);
          exit;}
          if($browser[0]=="Opera")
          {
          header (&#39;Location: http://www.google.ro/&#39;);
          exit;}
          if($browser[0]=="Safari")
          {
          header (&#39;Location: http://www.google.ro/&#39;);
          exit;}
          if($browser[0]=="http://Anonymouse.org")
          {
          header (&#39;Location: http://Anonymouse.org&#39;);
          exit;}
          ?></div>
          After that you can use include function eg:
          include("redirect.php");
          in all your files from script

          Because you script is in XHTML you can`t use ($HTTP_ACCEPT),"VND.WAP.WML") to accept only wap browsers
          and user can enter from some hide browsers
          For begin is good this code
          If you use $browser = explode("/ ",$HTTP_USER_AGENT); to show entire browser
          Modify in redirect.php corectly
          Also you can use this script to redirect any browser just put another lines like:

          if($browser[0]=="browser")
          {
          header (&#39;Location: http://www.some_site.com/&#39;);
          exit;}
          in redirect.php[/b][/quote]


          wat problem here ????

          Warning: explode() [function.explode]: Empty delimiter in public_html/xxxx/xxxxx/redirect.php on line 2

          Comment


            #6
            wat problem here ????[/b]

            do you need a better version of that?

            lol i want to share with you my own version..
            Services

            Are you looking to take your wap or wapsite to a higher level? Do you want to stand out and rise above your competitors?

            Below is a list of services I offer:

            Wap Design and Customized Coding -The first way to stand out in a crowd is to have a brilliant and unique design for your wap or wapsite.

            Rates

            General consulting – My current hourly rate is $100 / hour.
            Custom Wapsite Community - My current rate is $500 / Wap Community Development.

            Comment


              #7
              do you need a better version of that?

              lol i want to share with you my own version..[/b]

              Sue.... send me.... ;)

              Comment


                #8
                Sue.... send me.... ;)[/b]
                <div class='codetop'>CODE</div><div class='codemain' style='height:200px;white-space:pre;overflow:auto'>

                just edit this whatever you like mobile browsers and place it to your page
                <?php
                /*
                facedown_pogi@yahoo.com
                */

                //Define your mobile website alternative
                $site = "mydomain.com/web/page";

                //Defines the user browser
                $agent = $_SERVER[&#39;HTTP_USER_AGENT&#39;];
                /////////////////////////////////////////////////////$agent = explode("",$HTTP_USER_AGENT); use me or not
                //Check for various mobile browsers and redirect if confirmed
                if (eregi("mozilla", $agent)) {
                header( "Location: $site" ) ;
                }
                if (eregi("Palm OS", $agent)) {
                header( "Location: $site" ) ;
                }
                if (eregi("Blazer", $agent)) {
                header( "Location: $site" ) ;
                }
                if (eregi("Plucker", $agent)) {
                header( "Location: $site" ) ;
                }
                if (eregi("AvantGo", $agent)) {
                header( "Location: $site" ) ;
                }
                ?></div>


                i advise you to use the wapdesire redirect page in index.php go search that
                Services

                Are you looking to take your wap or wapsite to a higher level? Do you want to stand out and rise above your competitors?

                Below is a list of services I offer:

                Wap Design and Customized Coding -The first way to stand out in a crowd is to have a brilliant and unique design for your wap or wapsite.

                Rates

                General consulting – My current hourly rate is $100 / hour.
                Custom Wapsite Community - My current rate is $500 / Wap Community Development.

                Comment


                  #9
                  wat problem here ????

                  Warning: explode() [function.explode]: Empty delimiter in public_html/xxxx/xxxxx/redirect.php on line 2[/b]
                  Hmmm too many errors with this little code. Here is the fixed code
                  Attached Files

                  Comment


                    #10
                    i have a mobile site .also pc ver.i want redirect pc user on pc version...how?
                    any 1 help us by real code...

                    Comment


                      #11
                      and whos got a list of mobile browsers and web browsers?

                      Comment


                        #12
                        Code:
                        function mobile(){
                        if(stristr($_SERVER[&#39;HTTP_USER_AGENT&#39;],&#39;windows&#39;)&&!stristr($_SERVER[&#39;HTTP_USER_AGENT&#39;],&#39;windows ce&#39;))return false;
                        if(eregi(&#39;up.browser|up.link|windows ce|iemobile|mini|mmp|symbian|midp|wap|phone|pocket|mobile|pda|psp&#39;,$_SERVER[&#39;HTTP_USER_AGENT&#39;]))return true;
                        if(stristr($_SERVER[&#39;HTTP_ACCEPT&#39;],&#39;text/vnd.wap.wml&#39;)||stristr($_SERVER[&#39;HTTP_ACCEPT&#39;],&#39;application/vnd.wap.xhtml+xml&#39;))return true;
                        if(isset($_SERVER[&#39;HTTP_X_WAP_PROFILE&#39;])||isset($_SERVER[&#39;HTTP_PROFILE&#39;])||isset($_SERVER[&#39;X-OperaMini-Features&#39;])||isset($_SERVER[&#39;UA-pixels&#39;]))return true;
                        $a=array(&#39;acs-&#39;,&#39;alav&#39;,&#39;alca&#39;,&#39;amoi&#39;,&#39;audi&#39;,&#39;aste&#39;,&#39;avan&#39;,&#39;benq&#39;,&#39;bird&#39;,&#39;blac&#39;,&#39;blaz&#39;,&#39;brew&#39;,&#39;cell&#39;,&#39;cldc&#39;,&#39;cmd-&#39;,&#39;dang&#39;,&#39;doco&#39;,
                        &#39;eric&#39;,&#39;hipt&#39;,&#39;inno&#39;,&#39;ipaq&#39;,&#39;java&#39;,&#39;jigs&#39;,&#39;kddi&#39;,&#39;keji&#39;,&#39;leno&#39;,&#39;lg-c&#39;,&#39;lg-d&#39;,&#39;lg-g&#39;,&#39;lge-&#39;,&#39;maui&#39;,&#39;maxo&#39;,&#39;midp&#39;,&#39;mits&#39;,&#39;mmef&#39;,
                        &#39;mobi&#39;,&#39;mot-&#39;,&#39;moto&#39;,&#39;mwbp&#39;,&#39;nec-&#39;,&#39;newt&#39;,&#39;noki&#39;,&#39;opwv&#39;,&#39;palm&#39;,&#39;pana&#39;,&#39;pant&#39;,&#39;pdxg&#39;,&#39;phil&#39;,&#39;play&#39;,&#39;pluc&#39;,&#39;port&#39;,&#39;prox&#39;,&#39;qtek&#39;,
                        &#39;qwap&#39;,&#39;sage&#39;,&#39;sams&#39;,&#39;sany&#39;,&#39;sch-&#39;,&#39;sec-&#39;,&#39;send&#39;,&#39;seri&#39;,&#39;sgh-&#39;,&#39;shar&#39;,&#39;sie-&#39;,&#39;siem&#39;,&#39;smal&#39;,&#39;smar&#39;,&#39;sony&#39;,&#39;sph-&#39;,&#39;symb&#39;,&#39;t-mo&#39;,
                        &#39;teli&#39;,&#39;tim-&#39;,&#39;tosh&#39;,&#39;tsm-&#39;,&#39;upg1&#39;,&#39;upsi&#39;,&#39;vk-v&#39;,&#39;voda&#39;,&#39;w3c &#39;,&#39;wap-&#39;,&#39;wapa&#39;,&#39;wapi&#39;,&#39;wapp&#39;,&#39;wapr&#39;,&#39;webc&#39;,&#39;winw&#39;,&#39;winw&#39;,&#39;xda&#39;,&#39;xda-&#39;);
                        if(isset($a[substr($_SERVER[&#39;HTTP_USER_AGENT&#39;],0,4)]))return true;
                        }

                        Comment


                          #13
                          nice function ori

                          Comment

                          Working...
                          X