Guest User

Untitled

a guest
Jan 1st, 2016
172
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 4.12 KB | None | 0 0
  1. <?php
  2. require_once "recaptchalib.php";
  3. // your secret key
  4. $secret = "My secret key";
  5.  
  6.  
  7. // empty response
  8. $response = null;
  9.  
  10. // check secret key
  11. $reCaptcha = new ReCaptcha($secret);
  12.  
  13.  
  14. if ($_POST["g-recaptcha-response"]) {
  15.     $resp = $reCaptcha->verifyResponse(
  16.         $_SERVER["REMOTE_ADDR"],
  17.         $_POST["g-recaptcha-response"]
  18.     );
  19. }
  20.  
  21. ?>
  22.  
  23.  
  24.  
  25. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  26. <html xmlns="http://www.w3.org/1999/xhtml">
  27. <head>
  28. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  29. <link rel="stylesheet" type="text/css" href="style.css" />
  30. <title>Welcome to Indian Railways</title>
  31.  
  32. <script src='https://www.google.com/recaptcha/api.js'></script>
  33.  
  34.  
  35. </head>
  36.  
  37. <body>
  38.  
  39.  
  40. <div id="container">
  41.         <div id="header">
  42.         <h1>Check My PNR Status</h1>
  43.             <h2>INDIAN RAILWAYS PASSENGER RESERVATION ENQUIRY</h2>
  44.         </div>  
  45.        
  46.         <div id="menu">
  47.             <ul>
  48.                 <li class="menuitem"><a href="check-pnr-status.php">PNR Status</a></li>
  49.                 <li class="menuitem"><a href="seat-availability.php">Seat Availability</a></li>
  50.                 <li class="menuitem"><a href="train-running-information.php">Train Running Information</a></li>
  51.                 <li class="menuitem"><a href="trains-between-stations.php">Trains Between Stations</a></li>
  52.                 <li class="menuitem"><a href="train-route-information.php">Train Route Information</a></li>
  53.             </ul>
  54.         </div>
  55.        
  56.         <div id="leftmenu">
  57.  
  58.         <div id="leftmenu_top"></div>
  59.  
  60.                 <div id="leftmenu_main">    
  61.                
  62.                 <h3>Services</h3>
  63.                        
  64.                 <ul>
  65.                     <li><a href="check-pnr-status.php">Check PNR Status</a></li>
  66.                     <li><a href="seat-availability.php">Seat Availability</a></li>
  67.                     <li><a href="train-running-information.php">Train Running Info</a></li>
  68.                     <li><a href="train-route-information.php">Train Route Info</a></li>
  69.                     <li><a href="trains-between-stations.php">Trains Between Stations</a></li>
  70.                     <li><a href="train-name-number.php">Train Name/Number</a></li>
  71.                     <li><a href="station-name-to-code.php">Station Name to Code</a></li>
  72.                     <li><a href="station-code-to-name.php">Station Code to Name</a></li>
  73.                    
  74.                 </ul>
  75. </div>
  76.                
  77.                
  78.               <div id="leftmenu_bottom"></div>
  79.         </div>
  80.        
  81.        
  82.        
  83.        
  84.         <div id="content">
  85.        
  86.        
  87.         <div id="content_top"></div>
  88.         <div id="content_main">
  89.         <div id="success" style=" text-align: center;"></div>
  90.  
  91.         <form action="" method="post" id="get_train_running" >
  92.         <h3>Enter your particulars in the boxes below and click on "Show Trains" button to get information.</h3><br /><br />
  93.             <table border="0">
  94.             <tr><td>From:</td><td><input type="text" name="from_code"></td></tr>
  95.             <tr><td></td></tr>
  96.             <tr><td>To:</td><td><input type="text" name="to_code"></td></tr>
  97.             <tr><td></td></tr>
  98.             <tr><td>Date (DD-MM) :</td><td><input type="text" name="user_date" id="user_date"></td></tr>
  99.             <tr><td></td></tr>
  100.             <tr><td align="right" valign="top"> <div class="g-recaptcha" data-sitekey="My client key"></div> </td></tr>
  101.             <tr><td><input type="submit"  name="submit" id="submit" /></td></tr>
  102.            
  103.  
  104.  
  105.            
  106.     </table>
  107.     <br /><br /><br /><br />
  108.    
  109.     </form>
  110.         </div>
  111.         <div id="content_bottom"></div>
  112.            
  113.          
  114.       </div>
  115.    </div>
  116.    <script src="http://code.jquery.com/jquery-latest.js"></script>
  117.  
  118. <?php
  119. if ($resp != null && $resp->success):  ?>
  120.  
  121. echo"hi";
  122.  
  123. <script>
  124. $(document).ready(function(){
  125.  
  126. $("#submit").click(function(){
  127.  
  128. $.post("retrieve_train_between_stations.php", $("#get_train_running").serialize(),  function(response) {  
  129.  $("#success").html(response);
  130.  
  131.  
  132. });
  133. return false;
  134.  
  135.  
  136. });
  137.  
  138. });
  139. </script>
  140.        
  141.  
  142. <?php
  143. else:
  144. echo "Failed";
  145.  
  146. ?>
  147.  
  148.  
  149. <?php endif; ?>
  150.  
  151.  
  152.  
  153.    
  154. </body>
  155. </html>
Add Comment
Please, Sign In to add comment