Help Please

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

    Help Please

    How To Use This Code

    PHP Code:
    <?php
    header
    ("Content-type: text/vnd.wap.wml");
    header("Cache-Control: no-store, no-cache, must-revalidate");
    print 
    "<?xml version=\"1.0\" encoding=\"utf-8\"?>";
    echo 
    "<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\""" \"http://www.wapforum.org/DTD/wml_1.1.xml\">";

    ?>
    <wml>
    <?php
    /**
    *  ??: mobile
    *  ??: ?????
    *  ??: ?? ??
    */
    class mobile
    {
        
    /**
        *   ????:   getPhoneNumber
        *   ????:   ????
        *   ????:   none
        *   ?????: ???????????false
        *   ????:   ??
        */
        
    function getPhoneNumber()
        {
            if (isset(
    $_SERVER['HTTP_X_NETWORK_INFO']))
            {
                
    $str1 $_SERVER['HTTP_X_NETWORK_INFO'];
                
    $getstr1 preg_replace('/(.*,)(11[d])(,.*)/i','\2',$str1);
                Return 
    $getstr1;
            }
            elseif (isset(
    $_SERVER['HTTP_X_UP_CALLING_LINE_ID']))
            {
                
    $getstr2 $_SERVER['HTTP_X_UP_CALLING_LINE_ID'];
                Return 
    $getstr2;
            }
            elseif (isset(
    $_SERVER['HTTP_X_UP_SUBNO']))
            {
                
    $str3 $_SERVER['HTTP_X_UP_SUBNO'];
                
    $getstr3 preg_replace('/(.*)(11[d])(.*)/i','\2',$str3);
                Return 
    $getstr3;
            }
            elseif (isset(
    $_SERVER['DEVICEID']))
            {
                Return 
    $_SERVER['DEVICEID'];
            }
    }
        echo 
    "</p>";
    echo 
    "</card>";

    ?>
    </wml>
    Last edited by slash20009; 15.04.10, 18:05. Reason: change title

    #2
    What you mean with "how"?
    What you want to do with it?
    mysterio.al - programming is a functional art

    Comment


      #3
      Why you dont try to put it in one of your site page, and take a look what it affect...

      Comment


        #4
        put that code in your page, and then create its instance and call function to get output.
        like this..
        PHP Code:
        <?php
        $mobile
        =new mobile();
        $phone_number=$mobile->getPhoneNumber();
        ?>
        Follow me @ksg91 | My Blog: http://ksg91.com | Nokia Blog: http://NokiaTips.in

        Comment


          #5
          Fatal error: Class 'mobile' not found

          Comment


            #6
            Seperate the class frm ur page the include('theClassFile.php'); in wateva page u wana use it b4 instantiating the class like
            PHP Code:
            include('theClassFile.php');
            $mob = new mobile;
            ... 

            Comment


              #7
              Originally posted by mobileGIGS View Post
              Seperate the class frm ur page the include('theClassFile.php'); in wateva page u wana use it b4 instantiating the class like
              PHP Code:
              include('theClassFile.php');
              $mob = new mobile;
              ... 
              it is not necessary to put class in different file. problem is in class posted above check it. add }; in last to make it work.
              Follow me @ksg91 | My Blog: http://ksg91.com | Nokia Blog: http://NokiaTips.in

              Comment

              Working...
              X