Redirect Script...

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

    Redirect Script...

    i need a redirect script where just say im on pc or on my phone i goto http://blahblah.com it will redirect to web site if im on pc and to wap if in on my mobile?.. anyone got this? thanks

    #3
    search d forums iv seen it somewhere

    Comment


      #4
      i think this very good

      <div class='codetop'>CODE</div><div class='codemain' style='height:200px;white-space:pre;overflow:auto'><?php
      /**
      *
      * @package Multi Direct
      * @version 1.00 BETA 2006/12/02 12:30:00 devianceX
      * @copyright © 2001-2006 devianceX
      * @license http://opensource.org/licenses/gpl-license.php GNU Public License
      *
      */

      /**
      */

      //EDIT BELOW

      //your web url
      $WEB_URL = &#39;http://wapforum.uk.to/&#39;;

      //your wap 1.0 url
      $WAP_URL = &#39;http://wapforum.uk.to/wap/&#39;;

      //url for wap 2.0 and similar html and wml compatible browsers
      $BOTH_URL = &#39;http://wapforum.uk.to/archive/&#39;;

      //a url to redirect strange or unrecognized browsers, its very unlikely this will be needed
      $MMM_URL = &#39;http://wapforum.uk.to/&#39;;

      //DO NOT EDIT BELOW THIS LINE UNLESS YOUR EXPERIENCED IN PHP

      //if browser does NOT accept wml then html variable is true
      if ((eregi ("text/vnd.wap.wml", $HTTP_ACCEPT)) != true)
      {
      $HTML = &#39;TRUE&#39;;
      }

      //lets see if wml is true also or if its a pure web browser
      if ((eregi ("text/html", $HTTP_ACCEPT)) != true)
      {
      $WML = &#39;TRUE&#39;;
      }

      //if wml AND html are true it must be wap 2.0 phone and we should direct to html lo-fi (or give a choice)
      if ($HTML=&#39;TRUE&#39; AND $WML=&#39;TRUE&#39; AND $S60=&#39;FALSE&#39;)
      {
      //both wml and html set true
      $BOTH = &#39;TRUE&#39;;
      }

      //if wml and html true
      if ($BOTH=&#39;TRUE&#39;)
      {
      //redirect to both url
      //exit
      header("Location: $BOTH_URL");
      exit;
      }else
      {

      //if wml is true
      if ($WML=&#39;TRUE&#39;)
      {
      //redirect to wap url
      //exit
      header("Location: $WAP_URL");
      exit;
      }else
      {

      //if web is true
      if ($WEB=&#39;TRUE&#39;)
      {
      //redirect to web url
      //exit
      header("Location: $WEB_URL");
      exit;
      }else
      {

      //if for some strange reason its not any of the above let it carry on to the web site.. Or is it a bot? Pmpl
      //redirect to mmm
      //exit
      header("Location: $MMM_URL");
      exit;
      }}}

      // END OF REDIRECTION - SCRIPT BY DEVIANCEX
      // HTTP://WAPFORUM.UK.TO - THE BEST WAPFORUM
      ////////////////////////////////
      //© 2001-2006 devianceX
      ////////////////////////////////
      ?></div>

      Comment


        #5
        i need a redirect script where just say im on pc or on my phone i goto http://blahblah.com it will redirect to web site if im on pc and to wap if in on my mobile?.. anyone got this? thanks[/b]
        m8 you are advanced member here and you dont know the posts, parts and scripts on this forum...
        here is example:
        1. <blockquote><?php
        2. if ((eregi ("htm", $_SERVER[&#39;HTTP_ACCEPT&#39;])) == true){ ?>
        3. <!DOCTYPE html
        4. PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        5. "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
        6. <html>
        7. <head>
        8. <meta http-equiv="content-type" content="text/html;charset=utf-8" />
        9. <meta http-equiv="refresh" content="1;url=xhtml.php" />
        10. <title>ngeo chat</title>
        11. <link rel="stylesheet" type="text/css" href="style_logo/style.css" />
        12. </head>
        13. <body>
        14. <div align="center">
        15. Please wait...
          Click below if yo do not wish to wait, or your Mobile Phone don &apos;t make the transfer
        16. enter
        17. </div>
        18. </body>
        19. </html>
        20. <?php
        21. exit();
        22. }
        23. else
        24. {
        25. header("Content-type: text/vnd.wap.wml");
        26. header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
        27. header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
        28. header("Cache-Control: no-cache, must-revalidate");
        29. header("Pragma: no-cache");
        30. header("Provided-by:ngeo@ngeo.ro");
        31. echo "<?xml version=\"1.0\"?>
        32. <!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\""
        33. ." \"http://www.wapforum.org/DTD/wml_1.1.xml\">\n";
        34. ?>
        35. <wml>
        36. <card id="ngeo" title="ngeo chat" ontimer="wml.php">
        37. <timer value="1"/>
        38. <p align="center">
        39. Please wait...
          Click below if yo do not wish to wait, or your Mobile Phone don &apos;t make the transfer
        40. enter
        41. </p>
        42. </card>
        43. </wml>
        44. <?php
        45. exit();
        46. }
        47. ?></blockquote>
        http://ngeo.ro

        Comment


          #6
          thanks for the help

          Comment


            #7
            m8 is not so hard the cod for redirect

            Comment


              #8
              yes i know its not hard but when i posted this i had a bad headache and didnt want to code it, sorry

              Comment


                #9
                Sory mate but i dont wan&#39;t to ofend you Sory

                Comment


                  #10
                  lol its fine mate, i know what you are saying

                  Comment


                    #11
                    Code:
                    <?php
                    if ((eregi ("text/vnd.wap.wml", $HTTP_ACCEPT)) != true)
                            {
                            header("Location: http://yoursite.com");
                            exit;
                            }
                    else
                            {
                            header("Location: http://yoursite.com");
                            exit;
                            }
                    ?>
                    easy

                    Comment


                      #12
                      alredy got one thanks tho mate

                      Comment

                      Working...
                      X