My favorites
|
Sign in
india-std-identifier
Given an India STD code, identify location and state.
Project Home
Downloads
Wiki
Issues
Source
Checkout
|
Browse
|
Changes
|
r3
Source path:
svn
/
trunk
/
std_client.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<html><head><title>STD Identifier</title></head>
<body>
<h1>STD Code Identifier</h1>
<?php
$GLOBALS['THRIFT_ROOT'] = './thrift-php';
require_once($GLOBALS['THRIFT_ROOT'] . '/packages/std/STDService.php');
require($GLOBALS['THRIFT_ROOT'] . '/transport/TSocket.php');
require($GLOBALS['THRIFT_ROOT'] . '/protocol/TBinaryProtocol.php');
function lookup_number($number) {
$transport = new TBufferedTransport(new TSocket('localhost', 9090));
$protocol = new TBinaryProtocol($transport);
$client = new STDServiceClient($protocol);
$transport->open();
$info = $client->lookup($number);
$transport->close();
return $info;
}
if(isset($_GET['phone_number'])) {
$info = lookup_number($_GET['phone_number']);
?>
<p>Code Prefix: <?php echo $info['code_prefix'] ?></p>
<p>Area: <?php echo $info['area'] ?></p>
<p>State: <?php echo $info['state'] ?></p>
<?php
} else {
?>
<p>Type in your land line phone number with STD code to identify your city and state.</p>
<form action="<?php echo $_SERVER['PHP_SELF'] ?>">
<label for="phone_number">Phone Number:</label>
<input type="text" name="phone_number" id="phone_number" value="" /><br />
<input type="submit" value="Find Info!" />
</form>
<?php
}
?>
</body>
</html>
Show details
Hide details
Change log
r2
by g.vishnu on Jun 13, 2008
Diff
Initial commit.
Go to:
/trunk/doc
/trunk/doc/std_codes.html
/trunk/gen-php
/trunk/gen-php/STDService.php
/trunk/gen-php/std_types.php
/trunk/gen-rb
/trunk/gen-rb/STDService.rb
/trunk/gen-rb/std_constants.rb
/trunk/gen-rb/std_types.rb
/trunk/std.thrift
/trunk/std_client.php
/trunk/std_parser.rb
/trunk/std_server.rb
/trunk/thrift-php
/trunk/thrift-php/Thrift.php
/trunk/thrift-php/autoload.php
/trunk/thrift-php/ext
...k/thrift-php/ext/thrift_protocol
...hp/ext/thrift_protocol/config.m4
...protocol/php_thrift_protocol.cpp
...t_protocol/php_thrift_protocol.h
...ift-php/ext/thrift_protocol/tags
...p/ext/thrift_protocol/tags/1.0.0
...ft_protocol/tags/1.0.0/config.m4
...gs/1.0.0/php_thrift_protocol.cpp
...tags/1.0.0/php_thrift_protocol.h
/trunk/thrift-php/packages
/trunk/thrift-php/packages/std
/trunk/thrift-php/protocol
...php/protocol/TBinaryProtocol.php
...hrift-php/protocol/TProtocol.php
/trunk/thrift-php/transport
...transport/TBufferedTransport.php
...p/transport/TFramedTransport.php
...ft-php/transport/THttpClient.php
...-php/transport/TMemoryBuffer.php
...php/transport/TNullTransport.php
...ift-php/transport/TPhpStream.php
...thrift-php/transport/TSocket.php
...ft-php/transport/TSocketPool.php
...ift-php/transport/TTransport.php
Project members,
sign in
to write a code review
Older revisions
All revisions of this file
File info
Size: 1226 bytes, 41 lines
View raw file
Hosted by