Check to see if the web given web address is blocking visitors ip

Discussion in 'Content Management' started by Surajit Basak, Dec 7, 2015.

  1. #1
    I want to make an web application where a user inputs a web address and click to a submit button. Now what my application does it checks if the given web address is blocking his/her ip address. Can you please help me to make this web application? I want to use php and javascript.

    Basic PHP and HTML structure:
    <?php
    if ( isset( $_POST['check_status'] ) ) {
    
      $_POST = array_map( 'stripslashes', $_POST );
      extract( $_POST );
    
      if ( empty( $web_addr ) ) {
        $error = "Web address is required.";
      }
    
      if ( !isset( $error ) ) {
        function checkIpBlocked() {
          /* I need this code to check */
        }
      }
    }
    ?>
    
    <h2>Check your ip address is blocked or not</h2>
    <form action="" method="POST">
      <label for="web_addr">Enter Web Address</label>
      <input type="text" name="web_addr" placeholder="Enter Web Address">
      <input type="hidden" name="user_ip" value="<?php $_SERVER['REMOTE_ADDR']; ?>">
      <input type="submit" name="check_status" value="Check Status">
      <div id="status"><?php if ( isset( $error ) ) { echo $error } ?></div>
    </form>
    PHP:

     
    Surajit Basak, Dec 7, 2015 IP