Advertisement
Guest User

Untitled

a guest
Nov 21st, 2014
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.23 KB | None | 0 0
  1. if (!empty($_POST)) ...
  2.  
  3. if (!empty($_POST_01))... // regForm
  4. and
  5. if (!empty($_POST_02))... //loginForm
  6.  
  7. if ((!empty($_POST_01)) And $x = 0)...
  8.  
  9. <form action="login.php" method="post">
  10. <input type="text" name="user">
  11. <input type="password" name="password">
  12. <input type="submit" value="Login">
  13. </form>
  14.  
  15. <br />
  16.  
  17. <form action="register.php" method="post">
  18. <input type="text" name="user">
  19. <input type="password" name="password">
  20. <input type="submit" value="Register">
  21. </form>
  22.  
  23. <form action="doStuff.php" method="post">
  24. <input type="text" name="user">
  25. <input type="password" name="password">
  26. <input type="hidden" name="action" value="login">
  27. <input type="submit" value="Login">
  28. </form>
  29.  
  30. <br />
  31.  
  32. <form action="doStuff.php" method="post">
  33. <input type="text" name="user">
  34. <input type="password" name="password">
  35. <input type="hidden" name="action" value="register">
  36. <input type="submit" value="Register">
  37. </form>
  38.  
  39. switch($_POST['submit']) {
  40. case 'login':
  41. //...
  42. break;
  43. case 'register':
  44. //...
  45. break;
  46. }
  47.  
  48. if(isset($_POST['username']) && trim($_POST['username']) != "" && isset($_POST['password']) && trim($_POST['password']) != ""){
  49. //login
  50. } else {
  51. //register
  52. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement