Advertisement
Guest User

register.php

a guest
Mar 25th, 2015
258
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.94 KB | None | 0 0
  1. <? include("include/session.php"); ?>
  2.  
  3. <html>
  4.  
  5. <head>
  6.  
  7. <link rel="stylesheet" type="text/css" href="style-comunity.css">
  8.  
  9. </head>
  10.  
  11. <title></title>
  12.  
  13. <body>
  14.  
  15.  
  16.  
  17. <table width="100%" cellpadding="0" cellspacing="0">
  18.  
  19. <tr>
  20.  
  21.  
  22.  
  23. <td colspan="6" width="100%" bgcolor="#000000" ><img src="top.jpg" width="1000" height="154"></td>
  24.  
  25. </tr>
  26.  
  27. <tr align="right" bgcolor="#000000">
  28.  
  29. </tr>
  30.  
  31. <tr>
  32.  
  33. <td width="120"></td>
  34.  
  35. <td width="600" valign="top" height="300">
  36.  
  37.  
  38.  
  39. <?
  40.  
  41. /**
  42.  
  43. * The user is already logged in, not allowed to register.
  44.  
  45. */
  46.  
  47. if($session->logged_in){
  48.  
  49. echo "<h1>Allerede registreret</h1>";
  50.  
  51. echo "<p>Beklager<b>$session->username</b>, men du er allerede registreret. "
  52.  
  53. ."<a href=\"index.php\">Main</a>.</p>";
  54.  
  55. }
  56.  
  57. /**
  58.  
  59. * The user has submitted the registration form and the
  60.  
  61. * results have been processed.
  62.  
  63. */
  64.  
  65. else if(isset($_SESSION['regsuccess'])){
  66.  
  67. /* Registration was successful */
  68.  
  69. if($_SESSION['regsuccess']){
  70.  
  71. echo "<h1>Registeret!</h1>";
  72.  
  73. echo "<p>Tak <b>".$_SESSION['reguname']."</b>, dine informationer er tilføjet databasen, "
  74.  
  75. ."du kan nu <a href=\"index.php\">logge ind</a>.</p>";
  76.  
  77. }
  78.  
  79. /* Registration failed */
  80.  
  81. else{
  82.  
  83. echo "<h1>Registreringen lykkedes ikke</h1>";
  84.  
  85. echo "<p>Beklager, men der er sket en fejl i din registrering af brugernavnet <b>".$_SESSION['reguname']."</b>, "
  86.  
  87. ."<br> Venligst prøv igen på et senere tidspunkt!.</p>";
  88.  
  89. }
  90.  
  91. unset($_SESSION['regsuccess']);
  92.  
  93. unset($_SESSION['reguname']);
  94.  
  95. }
  96.  
  97. /**
  98.  
  99. * The user has not filled out the registration form yet.
  100.  
  101. * Below is the page with the sign-up form, the names
  102.  
  103. * of the input fields are important and should not
  104.  
  105. * be changed.
  106.  
  107. */
  108.  
  109. else{
  110.  
  111. ?>
  112.  
  113. <br><br>
  114.  
  115. <table><tr><td class="greentext">Opret bruger</td></tr></table>
  116.  
  117.  
  118.  
  119. <form action="process.php" method="POST">
  120.  
  121. <table align="left" border="0" cellspacing="0" cellpadding="0">
  122.  
  123. <tr><td>Brugernavn:</td><td><input class="input" type="text" name="user" maxlength="30" value="<? echo $form->value("user"); ?>"></td><? echo $form->error("user"); ?></tr>
  124.  
  125. <tr><td>Kodeord:</td><td><input class="input" type="password" name="pass" maxlength="30" value="<? echo $form->value("pass"); ?>"></td><? echo $form->error("pass"); ?></tr>
  126.  
  127. <tr><td>Fulde navn:</td><td><input class="input" type="text" name="name" maxlength="50" value="<? echo $form->value("name"); ?>"></td><? echo $form->error("name"); ?></tr>
  128.  
  129. <tr><td>Email:</td><td><input class="input" type="text" name="email" maxlength="50" value="<? echo $form->value("email"); ?>"></td><? echo $form->error("email"); ?></td></tr>
  130.  
  131. <tr><td>Alder:</td><td><input class="input" type="text" name="age" maxlength="2" value="<? echo $form->value("age"); ?>"></td><? echo $form->error("age"); ?></tr>
  132.  
  133. <tr><td>Favorit spil:</td><td><input class="input" type="text" name="game" maxlength="50" value="<? echo $form->value("game"); ?>"></td><? echo $form->error("game"); ?></tr>
  134.  
  135. <tr><td>Din beskrivelse:&nbsp;&nbsp;&nbsp;&nbsp;</td><td>
  136.  
  137. <SELECT class="input" NAME="description" >
  138.  
  139. <OPTION VALUE="Gamer" <? if($form->value("description") == "Gamer"){ echo "selected"; } ?>>Gamer</option>
  140.  
  141. <OPTION VALUE="Coder" <? if($form->value("description") == "Coder"){ echo "selected"; } ?>>Koder</option>
  142.  
  143. <OPTION VALUE="Random" <? if($form->value("description") == "Random"){ echo "selected"; } ?>>Blandet</option>
  144.  
  145. </SELECT></td></td><td><? echo $form->error("description"); ?></td></tr>
  146.  
  147. <tr><td valign="top">Quote:</td><td><textarea class="input" name="quote"></textarea></td><td></td></tr>
  148.  
  149. <tr><td></td>
  150.  
  151. <td><input type="hidden" name="subjoin" value="1"><input class="submitlink" type="submit" value="Opret!"></td></tr>
  152.  
  153. <tr><td colspan="2" align="left"><a href="index.php"><br><br>Tilbage til forsiden</a></td></tr>
  154.  
  155. </table>
  156.  
  157. </form>
  158.  
  159.  
  160.  
  161. <?
  162.  
  163. }
  164.  
  165. ?>
  166.  
  167. </td>
  168.  
  169. </tr>
  170.  
  171. </table>
  172.  
  173. </body>
  174.  
  175. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement