View Single Post
Old 08-13-2004, 11:11 AM   #5 (permalink)
RelaX
Follower of Ner'Zhul
 
RelaX's Avatar
 
Location: Netherlands
Well... if you have php and it can be as crappy as possible, why not just do:

PHP Code:
<?php 
// Put all your users in this array:
$users = array(
"HalX"=>"TFP",
"RelaX"=>"ThaMan",
"User"=>"Password");

echo 
'<?xml version="1.0" encoding="UTF-8"?>'

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
    "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
  <head>
    <title>Title of the page</title>
    <style type="text/css">
         html, body   { height: 100%; margin: 0; padding: 0;

                        color: white; text-align: center; }

         div.centered { border: 0; background-color: white; height: 50%; width: 50%;

                        position: absolute; left: 20%; top: 25%; color: black; }
                        
                        
         div.bottom { border: 0; background-color: white; height: 90%; width: 0%;

                        position: absolute; left: 80%; top: 80%; color: black; }
    </style>
  </head>
  <body>
  <?php
  
if ($users($_REQUEST["user"]) && $users($_REQUEST["user"])==$_REQUEST["password"])
  {
  
?>

  Real content here

  <?php
  
}
  else
  {
  
?>

  <div class="centered">
  <br /><br />
    <form action="<?php global $PHP_SELF; echo $PHP_SELF?>" method="post">
      <p>You must be logged in to see this page<br />

      Username: <input name="user" type="text" /><br />
      Password: <input name="password" type="password" /><br /><br />
      <input type="submit" value="Log in" /><br /></p>
    </form>
  </div>
  <div class="bottom">
    <p>
      <a href="http://validator.w3.org/check?uri=referer">
        <img src="http://www.w3.org/Icons/valid-xhtml11" alt="Valid XHTML 1.1!" height="31" width="88" border="0"/>
      </a>
    </p>
  </div>
  <?php
  
}
  
?>
  </body>
</html>
Or something like that (this is all from memory and bound to be flawed).

"It's quick... it's dirty... I love it"
Forget who said it, but it feels like an appropriate quotation.

EDIT: Okay, so I suck... I validated it and added the stylesheet some other guy made to center the damn thing. Make sure you have a recent php version for this though... my crappy 4.2.2 (Red Hat 9 ) wouldn't do the array() function, so it's kindof untested. But it should work. I do stuff like this for a living.
__________________
The most likely way for the world to be destroyed, most experts agree, is by accident. That's where we come in; we're computer professionals. We cause accidents.
- Nathaniel Borenstein

Last edited by RelaX; 08-13-2004 at 11:47 AM..
RelaX is offline  
 

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73