Help Please

Started on the old forum in April 2010 · view the original in the archive · old links redirect here

6 replies · 539 views · started 16 years ago · 1 min read

5 participants
slash20009 Junior · 21 posts #1

How To Use This 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>
Mysterio Lead · 630 posts #2

What you mean with "how"? What you want to do with it?

mysterio.al - programming is a functional art

ksg91 Developer · 162 posts #4

put that code in your page, and then create its instance and call function to get output. like this..

<?php
$mobile=new mobile();
$phone_number=$mobile->getPhoneNumber();
?>

Follow me @ksg91 | My Blog: http://ksg91.com | Nokia Blog: http://NokiaTips.in

CreativityKills Lead · 833 posts #6

Seperate the class frm ur page the include('theClassFile.php'); in wateva page u wana use it b4 instantiating the class like

include('theClassFile.php');
$mob = new mobile;
...
ksg91 Developer · 162 posts #7

mobileGIGS wrote: Seperate the class frm ur page the include('theClassFile.php'); in wateva page u wana use it b4 instantiating the class like

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

Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close