PageRenderTime 47ms CodeModel.GetById 21ms RepoModel.GetById 0ms app.codeStats 0ms

/register.php

http://ishudan.googlecode.com/
PHP | 66 lines | 52 code | 12 blank | 2 comment | 5 complexity | a5f9b56ef4f4cc4a051951864110e85d MD5 | raw file
Possible License(s): GPL-3.0
  1. <?php
  2. if ( ! isset($_GET['logout']))
  3. {
  4. $LOGIN = false;
  5. }
  6. require_once 'include/global.inc.php';
  7. if (false == $CFG_NEWUSERS)
  8. {
  9. die("Not Authorized!");
  10. }
  11. // count how many current users there are
  12. $query = "
  13. SELECT COUNT(*)
  14. FROM ".T_PLAYER."
  15. ";
  16. $num_players = $mysql->fetch_value($query, __LINE__, __FILE__);
  17. if ($num_players >= $CFG_MAXUSERS)
  18. {
  19. die("Not Authorized!");
  20. }
  21. // set a token
  22. $_SESSION['token'] = md5(uniqid(rand( ),true));
  23. echo "<?xml version=\"1.0\" encoding=\"iso-8859-1\"?>\n";
  24. ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
  25. "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
  26. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
  27. <head>
  28. <title>iShudan : Register</title>
  29. <meta http-equiv="Content-Language" content="en-us" />
  30. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  31. <meta http-equiv="Content-Style-Type" content="text/css" />
  32. <link rel="stylesheet" href="css/iShudan.css" type="text/css" />
  33. <script type="text/javascript" src="javascript/md5.js"></script>
  34. <script type="text/javascript" src="javascript/validate.js"></script>
  35. </head>
  36. <body>
  37. <div id="links"><?php echo $CFG_SITELINKS; ?></div>
  38. <h1>iShudan :: registration</h1>
  39. <form method="post" action="index.php" name="userdata" style="padding:10em;" onsubmit="validateform( );">
  40. <?php if (isset($error)) { echo '<div class="error">' . $error . '</div>'; } ?>
  41. <input type="hidden" name="token" value="<?php echo $_SESSION['token']; ?>" />
  42. <input type="text" name="txtUsername" id="txtUsername" value="username" onfocus="this.value='';" tabindex="1" /><br />
  43. <input type="text" name="pwdPassword" id="pwdPassword" value="password" onfocus="this.type='password';this.value='';" tabindex="2" /><br />
  44. <input type="text" name="pwdPassword2" id="pwdPassword2" value="again" onfocus="this.type='password';this.value='';" tabindex="3" /><br />
  45. <input type="text" name="txtEmail" value="email@address" onfocus="this.value='';" tabindex="4" /><br />
  46. <input type="submit" name="register" value="submit" tabindex="5" />
  47. <a href="login.php">log in</a>
  48. </form>
  49. <div id="footer">iShudan v<?php echo $VERSION; ?> - last updated on <?php echo $MOD_DATE; ?><br />
  50. this program is free software released under the GPL and is based on phpGo available on SourceForge<br />
  51. Join our Google Code Project: <a href="http://code.google.com/p/ishudan/">http://code.google.com/p/ishudan/</a><br />
  52. Download a copy of this program and source code: <a href="http://code.google.com/p/ishudan/source">http://code.google.com/p/ishudan/source</a></div>
  53. </body>
  54. </html>