Basic PHP Login and Forwarding


/ Published in: PHP
Save to your folder(s)



Copy this code and paste it in your HTML
  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


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.