A unf. social network done poorly.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

216 lines
6.2KB

  1. <?php
  2. ini_set('display_errors', '1');
  3. require_once($_SERVER['DOCUMENT_ROOT'] . '/socialtune/includes/session.php');
  4. require_once($_SERVER['DOCUMENT_ROOT'] . '/socialtune/includes/config.php');
  5. if(isset($_SESSION['Authenticated']) && $_SESSION['Authenticated']){
  6. require_once($_SERVER['DOCUMENT_ROOT'] . '/socialtune/includes/user-data.php');
  7. if($_SESSION['Expires'] < time()){
  8. // Log out here.
  9. exit();
  10. header("Location: logout.php");
  11. }
  12. $_SESSION['Expires'] = time() + 86400; // if logged in, set to 24 hours.
  13. header("Location: Dashboard.php");
  14. }
  15. ?>
  16. <!DOCTYPE html>
  17. <html lang="en">
  18. <head>
  19. <meta charset="utf-8">
  20. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  21. <meta name="viewport" content="width=device-width, initial-scale=1">
  22. <title>SocialTune | Signup</title>
  23. <!--// bootstrap //-->
  24. <link href="css/bootstrap.css" rel="stylesheet">
  25. <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
  26. <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
  27. <!--[if lt IE 9]>
  28. <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
  29. <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
  30. <![endif]-->
  31. <style>
  32. html,
  33. body{
  34. height: 100%;
  35. }
  36. #wrap{
  37. min-height: 100%;
  38. height: auto !important;
  39. height: 100%
  40. margin: 0 auto -60px;
  41. }
  42. #push,
  43. #footer{
  44. height: 60px;
  45. }
  46. @media(max-width: 767px){
  47. #footer{
  48. margin-left: -20px;
  49. margin-right: -20px;
  50. padding-left: 20px;
  51. padding-right: 20px;
  52. }
  53. }
  54. </style>
  55. </head>
  56. <body>
  57. <div id="wrap">
  58. <!--// Navigation //-->
  59. <nav class="navbar navbar-default navbar-fixed-top">
  60. <div class="container">
  61. <div class="navbar-header">
  62. <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
  63. <span class="sr-only">Toggle Navigation</span>
  64. <span class="icon-bar"></span>
  65. <span class="icon-bar"></span>
  66. <span class="icon-bar"></span>
  67. </button>
  68. <a class="navbar-brand" href="#">Social.Tune</a>
  69. </div>
  70. <div id="navbar" class="navbar-collapse collapse">
  71. <ul class="nav navbar-nav">
  72. <li><a href="index.php">Login</a></li>
  73. <li class="active"><a href="signup.php">Signup</a></li>
  74. <li><a href="about.php">About</a></li>
  75. </ul>
  76. </div>
  77. </div>
  78. </nav>
  79. <!--// Content //-->
  80. <div class="container">
  81. <div class="jumbotron">
  82. <div class="row">
  83. <div class="col-md-3"></div>
  84. <div class="col-md-4">
  85. <!--// Add signup. //-->
  86. <form method="POST" action="register.php">
  87. <div class="form-group">
  88. <div class="col-xs-6">
  89. <input type="first_name" class="form-control" name="first_name" id="first_name" placeholder="First Name">
  90. </div>
  91. <div class="col-xs-6">
  92. <input type="last_name" class="form-control" name="last_name" id="last_name" placeholder="Last Name">
  93. </div>
  94. </div>
  95. <div class="form-group">
  96. <div class="col-xs-12">
  97. <input type="email" class="form-control" name="email" id="email" placeholder="Email">
  98. </div>
  99. <div class="col-xs-6"></div>
  100. </div>
  101. <div class="form-group">
  102. <div class="col-xs-12">
  103. <input type="password" class="form-control" name="password" id="password" placeholder="Password">
  104. </div>
  105. </div>
  106. <br />
  107. <div class="form-group">
  108. <div class="col-xs-12">
  109. <center><h2>Birthdate</h2></center>
  110. </div>
  111. <div class="col-xs-4"> <!--// Month //-->
  112. <select class="form-control" style="font-size:12px;" name="month">
  113. <option>Month</option>
  114. <?php /* Consider changing to date names and do a bunch of if-statements to convert "Jan -> 01" etc. */
  115. $month = 01;
  116. while($month <= 12){
  117. echo '<option>'.$month.'</option>';
  118. $month = $month + 1;
  119. }
  120. ?>
  121. </select>
  122. </div>
  123. <div class="col-xs-4"> <!--// Day //-->
  124. <select class="form-control" style="font-size:12px;" name="day">
  125. <option>Day</option>
  126. <?php
  127. $day = 1;
  128. while($day <= 31){
  129. echo '<option>'.$day.'</option>';
  130. $day = $day + 1;
  131. }
  132. ?>
  133. </select>
  134. </div>
  135. <div class="col-xs-4"> <!--// Year //-->
  136. <select class="form-control" style="font-size:12px;" name="year">
  137. <option>Year</option>
  138. <?php
  139. $year = 2015;
  140. while($year >= 1900){
  141. echo '<option>'.$year.'</option>';
  142. $year = $year - 1;
  143. }
  144. ?>
  145. </select>
  146. </div>
  147. </div>
  148. <div class="col-xs-12">
  149. <p style="font-size: 10px;"><br />By clicking "Sign up", you agree to our <a href="">terms of service</a> and that you allow your computer to enjoy our <a href="">cookies</a>.</p>
  150. <center><button type="submit" class="btn btn-primary">Sign up</button></center>
  151. </div>
  152. </form>
  153. </div>
  154. </div>
  155. <br />
  156. <p style="font-size: 8px;">Are you a <a href="band-signup.php">band</a>?</p>
  157. </div>
  158. </div>
  159. <?php // if the email is already in use.
  160. $inUse = (!empty($_GET['q'])) ? $_GET['q'] : false;
  161. if($inUse == 1){
  162. echo '<center><h2>The email is already registered. Try a different one or <a href="index.php">login</a></h2></center>';
  163. }
  164. if($inUse == 2){
  165. echo '<center><h2>You forgot to fill something in.</h2></center>';
  166. }
  167. ?>
  168. <div id="push"></div>
  169. </div>
  170. </div> <!--## ending wrap ##-->
  171. <!--// Footer //-->
  172. <div id="footer">
  173. <div class="container">
  174. <div class="row">
  175. <div class="col-md-4">
  176. <p style="font-size: 12px;">Social.Tune &copy; 2015</p>
  177. </div>
  178. <div class="col-md-8">
  179. <p class="text-right" style="font-size: 12px;">
  180. | <a href="">English</a> | <a href="">汉语</a> | <a href="">日本語</a> |
  181. <a href="">français</a> |<br /> | <a href="">Social-Tune</a> |
  182. <a href="">About Us</a> |<a href="">Contact Us</a> | <a href="">Careers</a> |
  183. <a href="">Privacy</a> | <a href="">License</a> | <a href="">Help</a> |
  184. </p>
  185. </div>
  186. </div>
  187. </div>
  188. </div>
  189. </div>
  190. </body>
  191. </html>