Registration form php mysql download - Helpwalaa - Free IT Updates & Opportunities

New Updates

Registration form php mysql download

Signup Login page in PHP with Database MySQL Source Code

I have also written step by step Tutorial for Restful Web Services in PHP Example – PHP + MySQL Best Practice. Today I’m going to connect login & Signup Webservices using Login & Signup HTML page. You can use any HTML page, I’m using This because it has a really beautiful design and has Form for both Login & Signup.

What we’ll cover in Signup Login page in PHP with Database

  1. File Structure
  2. Creating HTML page
  3. Connecting HTML page with Webservices

File Structure

We’ll use this folders & files structure inside our “app” folder for our Login & Signup page.
index.html
 |
assets
├─── css
├────── style.css
api
├─── config/
├────── database.php – file used for connecting to the database.
├─── objects/
├────── user.php – contains properties and methods for “user” database queries.
├─── User/
├────── signup.php – file that will accept user data to be saved to the DB.
├────── login.php – file that will accept username & password and validate
as you can see that we have added pages and assets folders, pages folder will contain all HTML pages and assets folder is for CSS, JS, images etc.

Creating HTML page

as I stated that you can create your own design or you can use any other design, for this tutorial I’m using This template and I just modified it according to my Webservices.
inside your “app” folder, create a new file as “index.html” and paste this code there
  1. <!DOCTYPE html>
  2. <html lang="en" >
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>PHP Learning</title>
  6. <link rel='stylesheet prefetch' href='https://fonts.googleapis.com/css?family=Open+Sans:600'>
  7. <link rel="stylesheet" href="./assets/css/style.css">
  8. </head>
  9. <body>
  10. <div class="login-wrap">
  11. <div class="login-html">
  12. <input id="tab-1" type="radio" name="tab" class="sign-in" checked><label for="tab-1" class="tab">Sign In</label>
  13. <input id="tab-2" type="radio" name="tab" class="sign-up"><label for="tab-2" class="tab">Sign Up</label>
  14. <div class="login-form">
  15. <form class="sign-in-htm" action="./api/user/login.php" method="GET">
  16. <div class="group">
  17. <label for="user" class="label">Username</label>
  18. <input id="username" name="username" type="text" class="input">
  19. </div>
  20. <div class="group">
  21. <label for="pass" class="label">Password</label>
  22. <input id="password" name="password" type="password" class="input" data-type="password">
  23. </div>
  24. <div class="group">
  25. <input id="check" type="checkbox" class="check" checked>
  26. <label for="check"><span class="icon"></span> Keep me Signed in</label>
  27. </div>
  28. <div class="group">
  29. <input type="submit" class="button" value="Sign In">
  30. </div>
  31. <div class="hr"></div>
  32. <div class="foot-lnk">
  33. <a href="#forgot">Forgot Password?</a>
  34. </div>
  35. </form>
  36. <form class="sign-up-htm" action="./api/user/signup.php" method="POST">
  37. <div class="group">
  38. <label for="user" class="label">Username</label>
  39. <input id="username" name="username" type="text" class="input">
  40. </div>
  41. <div class="group">
  42. <label for="pass" class="label">Password</label>
  43. <input id="password" name="password" type="password" class="input" data-type="password">
  44. </div>
  45. <div class="group">
  46. <label for="pass" class="label">Confirm Password</label>
  47. <input id="pass" type="password" class="input" data-type="password">
  48. </div>
  49. <div class="group">
  50. <input type="submit" class="button" value="Sign Up">
  51. </div>
  52. <div class="hr"></div>
  53. <div class="foot-lnk">
  54. <label for="tab-1">Already Member?</a>
  55. </div>
  56. </form>
  57. </div>
  58. </div>
  59. </div>
  60. </body>
  61. </html>
Now go to the “assets” folder and create a new folder as “css” and create a new file there as “style.css” and paste this code there
  1. body{
  2. margin:0;
  3. color:#6a6f8c;
  4. background:#c8c8c8;
  5. font:600 16px/18px 'Open Sans',sans-serif;
  6. }
  7. *,:after,:before{box-sizing:border-box}
  8. .clearfix:after,.clearfix:before{content:'';display:table}
  9. .clearfix:after{clear:both;display:block}
  10. a{color:inherit;text-decoration:none}
  11. .login-wrap{
  12. width:100%;
  13. margin:auto;
  14. margin-top: 30px;
  15. max-width:525px;
  16. min-height:570px;
  17. position:relative;
  18. background:url(http://codinginfinite.com/demo/images/bg.jpg) no-repeat center;
  19. box-shadow:0 12px 15px 0 rgba(0,0,0,.24),0 17px 50px 0 rgba(0,0,0,.19);
  20. }
  21. .login-html{
  22. width:100%;
  23. height:100%;
  24. position:absolute;
  25. padding:90px 70px 50px 70px;
  26. background:rgba(40,57,101,.9);
  27. }
  28. .login-html .sign-in-htm,
  29. .login-html .sign-up-htm{
  30. top:0;
  31. left:0;
  32. right:0;
  33. bottom:0;
  34. position:absolute;
  35. -webkit-transform:rotateY(180deg);
  36. transform:rotateY(180deg);
  37. -webkit-backface-visibility:hidden;
  38. backface-visibility:hidden;
  39. transition:all .4s linear;
  40. }
  41. .login-html .sign-in,
  42. .login-html .sign-up,
  43. .login-form .group .check{
  44. display:none;
  45. }
  46. .login-html .tab,
  47. .login-form .group .label,
  48. .login-form .group .button{
  49. text-transform:uppercase;
  50. }
  51. .login-html .tab{
  52. font-size:22px;
  53. margin-right:15px;
  54. padding-bottom:5px;
  55. margin:0 15px 10px 0;
  56. display:inline-block;
  57. border-bottom:2px solid transparent;
  58. }
  59. .login-html .sign-in:checked + .tab,
  60. .login-html .sign-up:checked + .tab{
  61. color:#fff;
  62. border-color:#1161ee;
  63. }
  64. .login-form{
  65. min-height:345px;
  66. position:relative;
  67. -webkit-perspective:1000px;
  68. perspective:1000px;
  69. -webkit-transform-style:preserve-3d;
  70. transform-style:preserve-3d;
  71. }
  72. .login-form .group{
  73. margin-bottom:15px;
  74. }
  75. .login-form .group .label,
  76. .login-form .group .input,
  77. .login-form .group .button{
  78. width:100%;
  79. color:#fff;
  80. display:block;
  81. }
  82. .login-form .group .input,
  83. .login-form .group .button{
  84. border:none;
  85. padding:15px 20px;
  86. border-radius:25px;
  87. background:rgba(255,255,255,.1);
  88. }
  89. .login-form .group input[data-type="password"]{
  90. text-security:circle;
  91. -webkit-text-security:circle;
  92. }
  93. .login-form .group .label{
  94. color:#aaa;
  95. font-size:12px;
  96. }
  97. .login-form .group .button{
  98. background:#1161ee;
  99. }
  100. .login-form .group label .icon{
  101. width:15px;
  102. height:15px;
  103. border-radius:2px;
  104. position:relative;
  105. display:inline-block;
  106. background:rgba(255,255,255,.1);
  107. }
  108. .login-form .group label .icon:before,
  109. .login-form .group label .icon:after{
  110. content:'';
  111. width:10px;
  112. height:2px;
  113. background:#fff;
  114. position:absolute;
  115. transition:all .2s ease-in-out 0s;
  116. }
  117. .login-form .group label .icon:before{
  118. left:3px;
  119. width:5px;
  120. bottom:6px;
  121. -webkit-transform:scale(0) rotate(0);
  122. transform:scale(0) rotate(0);
  123. }
  124. .login-form .group label .icon:after{
  125. top:6px;
  126. right:0;
  127. -webkit-transform:scale(0) rotate(0);
  128. transform:scale(0) rotate(0);
  129. }
  130. .login-form .group .check:checked + label{
  131. color:#fff;
  132. }
  133. .login-form .group .check:checked + label .icon{
  134. background:#1161ee;
  135. }
  136. .login-form .group .check:checked + label .icon:before{
  137. -webkit-transform:scale(1) rotate(45deg);
  138. transform:scale(1) rotate(45deg);
  139. }
  140. .login-form .group .check:checked + label .icon:after{
  141. -webkit-transform:scale(1) rotate(-45deg);
  142. transform:scale(1) rotate(-45deg);
  143. }
  144. .login-html .sign-in:checked + .tab + .sign-up + .tab + .login-form .sign-in-htm{
  145. -webkit-transform:rotate(0);
  146. transform:rotate(0);
  147. }
  148. .login-html .sign-up:checked + .tab + .login-form .sign-up-htm{
  149. -webkit-transform:rotate(0);
  150. transform:rotate(0);
  151. }
  152. .hr{
  153. height:2px;
  154. margin:60px 0 50px 0;
  155. background:rgba(255,255,255,.2);
  156. }
  157. .foot-lnk{
  158. text-align:center;
  159. }
Now you’ll see the page same as this
login signup page with php mysql api

Connecting HTML page with Webservices

Download Login & Signup API from Github you can also create these API following my previous post, Restful Web Services in PHP Example – PHP + MySQL Best Practice

setup Database and paste “api” folder inside “app” folder.
all done, Now you can run your index.html through localhost.

Most Popular