Hi ,
I am creating a web application using PHP and MySQL in IIS Server.What shall i do to make my application to be accessed from a mobile phone.Now my web pages can be accessed from a PC

Thanks in advance
Dhanya

    Hi Merve,
    Thanks for ur reply.I know WML. What i need to know is if i have WML pages and html pages in the web server , how the mobile phones will get those wml pages.I am giving the same address ie http request using mobile phone also.Is there a way by which i can convert this http and to get directed to the wml pages.

    Thanks
    Dhanya

      just use a header redirection.

      Its hard to distinguish if the user is using a mobile phone because of all the makes, models and different browsers.

      You can try checking for Mozilla, windows or linux/unix in the user agent e.g.

      <?php
      //this would probably be best suited in a index.php page
      if(!eregi("mozilla",$_SERVER['HTTP_USER_AGENT']) OR !eregi("linux",$_SERVER['HTTP_USER_AGENT']) or !eregi("windows",$_SERVER['HTTP_USER_AGENT']) OR !eregi("mac",$_SERVER['HTTP_USER_AGENT']) OR !eregi("unix",$_SERVER['HTTP_USER_AGENT']))
      {
      	header("Location: http://www.yoursite.com/wap.wml");
      	exit;
      }else{
      //redirect to your html or continue with your page
      }
      ?>
      

      Note that opera and windows are now on mobile phones so the above redirection will not work that well.
      Also you can just merge the above eregi's into one. I ripped that from a script I wrote 2 years ago.

      Sorry if thats not the answer your looking for. Its really hard to understand you.

        if your looking for a php based solution, try this.

        
        if (false !== strpos(strtolower($_SERVER['HTTP_ACCEPT']), 'wml')) {
            // its wml capable
        }
        
        
        

        that assumes all mobile phones/ pda's etc will send an accept header, which i would think they all should.

        this really isnt my area of expertise but i think most/many recent mobile devices also understand xhtml and maybe even html.

        i know my 2-3 year old phone understood xhtml just fine.

        but from the little i know about wml, it just seems like it a much better choice.
        so much less markup involved.

          Write a Reply...