Searching

We make a new PHP form.
then we create a input with type of a button.
So we can push this to the UserInput field.

PHP form button
  type="button" 
  id="<?php echo htmlspecialchars($UserPublicIP);?>"
  value="Your IP"
  onclick="ChangeInput(this)

Now we need a JS script.
Sets the input in the text box "UserInput" with,
the PHP varriable $UserPublicIP.

Button JS function
  function ChangeInput(o){
      document.getElementById('UserInput').value=o.id;
    }

Now we have to create a search form.
We will create a input box with the name "UserInput"
This way we can later recall this with a PHP post request.

PHP form user input
  name="UserInput" 
  pattern="^((\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.){3}(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])$"

Now we can make a PHP variable.
So we can later recall it.

PHP post to $var
  $ipaddress = $_POST['UserInput'];