Advertisement
asimryu

index.php for login - 1

Jan 4th, 2017
167
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.21 KB | None | 0 0
  1. <?php
  2. session_start();
  3. $islogin = false;
  4. if( isset($_SESSION['userid']) ){
  5. if( $_SESSION['userid'] ) {
  6. $islogin = true;
  7. }
  8. }
  9. ?>
  10. <!DOCTYPE html>
  11. <html lang="en">
  12. <head>
  13. <meta charset="UTF-8">
  14. <title>Member</title>
  15. </head>
  16. <body>
  17. <div>
  18. <?php if( ! $islogin ): ?>
  19. <form action="login.php" method="POST">
  20. <label for="userid">아이디</label>
  21. <input type="text" id="userid" name="userid" placeholder="your id...">
  22. <label for="userpw">비밀번호</label>
  23. <input type="password" id="userpw" name="userpw">
  24. <button type="submit">로그인</button>
  25. </form>
  26. <form action="join.php" method="POST">
  27. <h1>회원가입</h1>
  28. <label for="uid">아이디</label>
  29. <input type="text" id="uid" name="uid"><br>
  30. <label for="uname">이름</label>
  31. <input type="text" id="uname" name="uname"><br>
  32. <label for="upw">비밀번호</label>
  33. <input type="password" id="upw" name="upw"><br>
  34. <button type="text">가입하기</button>
  35. </form>
  36. <?php else: ?>
  37. <form action="logout.php" method="GET">
  38. <?php echo $_SESSION['userid'];?>
  39. <?php echo $_SESSION['username'];?>
  40. <button type="submit">로그아웃</button>
  41. </form>
  42. <?php endif ?>
  43. </div>
  44. </body>
  45. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement