Posted By

iroybot on 02/06/09


Tagged

login auth php dir user


Versions (?)

Who likes this?

2 people have marked this snippet as a favorite

BrianCoyDesign
iroybot


Basic PHP Login and Forwarding


 / Published in: PHP
 

  1. <form method="post"action="">
  2. <p />User: <input type="text" name="user" />
  3. <p />Passwort: <input type="password" name="pw" />
  4. <p /><input type="submit" />
  5. </form>
  6. <?
  7. $_SERVER['PHP_AUTH_USER'] = $_POST['user'];
  8. $_SERVER['PHP_AUTH_PW'] = $_POST['pw'];
  9. header('Location: http://deinedomain.tld/login/'.$_POST['user']);
  10. ?>

Report this snippet  

You need to login to post a comment.