Пример #1
0
<?php

require 'classes/zipcode.php';
require_once 'common/header.php';
if (isset($_POST['submit'])) {
    // $address = 'Kothapet, Anantapur, Andhra Pradesh, India';
    $res = '';
    $zc = new Zipcode();
    $res = $zc->getPincode(trim($_POST['address']));
}
?>
<h1> Find Pincode</h1>
<div class="row" style="margin-bottom: 10px;">
    <form id="pin-form" role="form" method="post" action="<?php 
echo $_SERVER['PHP_SELF'];
?>
">
      <div class="form-group">
            <div class="col-sm-4">
                <input type="text" class="form-control" id="address" name="address" placeholder="Enter Address" value="<?php 
if (isset($_POST['address'])) {
    echo $_POST['address'];
}
?>
">
            </div>
      </div>
       <div class="form-group">
           <div class="col-md-4">
               <button type="submit" class="btn btn-default" name="submit">Get Pincode</button>
           </div>