title: How to design javascript prompt box with multiple fields
body: <p>As far as I can tell from my research, you can't have a multiple-field prompt dialog with any built-in method you can call from JavaScript. So how do the homepages of most routers (192.168.0.1) develop the authentication prompt box, as shown below?</p>
  
  <p><strong>I did a little more research and found that you can setup a basic http authentication using php</strong></p>
  
  <pre><code>$user = 'user';
  $password = 'pass';
  if (!($_SERVER['PHP_AUTH_USER'] == $user &amp;&amp; $_SERVER['PHP_AUTH_PW'] == $password)) {
      header('WWW-Authenticate: Basic realm="Please enter username and password to access this website"');
      header('HTTP/1.0 401 Unauthorized');
      echo '&lt;h1&gt;Unauthorized Access&lt;/h1&gt;';
      exit;
  }
  echo "normal website contents";
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/LngA0.png" alt="1"></p>