Advertisement
Guest User

Untitled

a guest
Jun 21st, 2013
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 14.13 KB | None | 0 0
  1. <?php
  2.  
  3. session_start();
  4. require "mysql.php";
  5. require "global_func.php";
  6.  
  7. print <<<EOF
  8.  
  9. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  10. <html xmlns="http://www.w3.org/1999/xhtml">
  11. <head>
  12. <script language="JavaScript">
  13. <!--
  14. function getCookieVal (offset) {
  15.   var endstr = document.cookie.indexOf (";", offset);
  16.   if (endstr == -1)
  17.   endstr = document.cookie.length;
  18.   return unescape(document.cookie.substring(offset, endstr));
  19. }
  20. function GetCookie (name) {
  21.   var arg = name + "=";
  22.   var alen = arg.length;
  23.   var clen = document.cookie.length;
  24.   var i = 0;
  25.   while (i < clen) {
  26.   var j = i + alen;
  27.   if (document.cookie.substring(i, j) == arg)
  28.   return getCookieVal (j);
  29.   i = document.cookie.indexOf(" ", i) + 1;
  30.   if (i == 0) break;
  31.   }
  32.   return null;
  33. }
  34. function SetCookie (name,value,expires,path,domain,secure) {
  35.   document.cookie = name + "=" + escape (value) +
  36.   ((expires) ? "; expires=" + expires.toGMTString() : "") +
  37.   ((path) ? "; path=" + path : "") +
  38.   ((domain) ? "; domain=" + domain : "") +
  39.   ((secure) ? "; secure" : "");
  40. }
  41. function DeleteCookie (name,path,domain) {
  42.   if (GetCookie(name)) {
  43.   document.cookie = name + "=" +
  44.   ((path) ? "; path=" + path : "") +
  45.   ((domain) ? "; domain=" + domain : "") +
  46.   "; expires=Thu, 01-Jan-70 00:00:01 GMT";
  47.   }
  48. }
  49. // -->
  50. </script>
  51. <script language="JavaScript">
  52. var usr;
  53. var pw;
  54. var sv;
  55. function getme()
  56. {
  57. usr = document.login.username;
  58. pw = document.login.password;
  59. sv = document.login.save;
  60.    if (GetCookie('player') != null)
  61.    {
  62.         usr.value = GetCookie('username')
  63.         pw.value = GetCookie('password')
  64.         if (GetCookie('save') == 'true')
  65.         {
  66.         sv[0].checked = true;
  67.         }
  68.    }
  69. }
  70. function saveme()
  71. {
  72.    if (usr.value.length != 0 && pw.value.length != 0)
  73.    {
  74.         if (sv[0].checked)
  75.         {
  76.                 expdate = new Date();
  77.                 expdate.setTime(expdate.getTime()+(365 * 24 * 60 * 60 * 1000));
  78.                 SetCookie('username', usr.value, expdate);
  79.                 SetCookie('password', pw.value, expdate);
  80.                 SetCookie('save', 'true', expdate);
  81.         }
  82.                 if (sv[1].checked)
  83.                 {
  84.                 DeleteCookie('username');
  85.                 DeleteCookie('password');
  86.                 DeleteCookie('save');
  87.                 }
  88.         }
  89.                 else
  90.         {
  91.                 alert('You must enter a username/password.');
  92.                 return false;
  93.         }
  94. }
  95. </script>
  96. </head>
  97. <head>
  98. <!--
  99.         SEO Requirements
  100. -->
  101. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  102. <meta name="description" content="Massive online multiplayer text based RPG game. Gangster warfare at its best.">
  103. <meta name="keywords" content="rpg games, fun games, online rpg, multiplayer games, play free game, free rpg, rpg game, online mmorpg, mmorpg games, fun game">
  104. <meta name="robots" content="index,follow" />
  105. <meta name="author" content="Dragon Blade">
  106. <link href="css/style.css" rel="stylesheet" type="text/css" />
  107. <style type="text/css">
  108. <!--
  109.         @import url("css/layout.css");
  110. -->
  111. </style>
  112. <title>LostNation</title>
  113. </head>
  114. <div id="wrapper" class="bg7">
  115.         <div class="bg8">
  116.              <div id="wrapperA"></div>
  117.                 <div class="content">
  118.                         <div id="header">
  119.                                 <div id="logo">
  120.                                 <h1>LostNation</h1>
  121.                                 <h2>&nbsp;</h2>
  122.                                 </div>
  123.                                 <div id="splash">
  124.                                 <h3>&nbsp;</h3>
  125.                                 </div>
  126.                         </div>
  127.                         <div id="mainmenu" class="bg3" style="margin-left: 15px;">
  128.                                 <ul>
  129.                                         <li><a href="login.php" id="mainmenu1" accesskey="1" title="" class="link1">Home</a></li>
  130.                                         <li><a href="news.php" id="mainmenu2" accesskey="2" title="" class="link1 vline">News</a></li>
  131.                                         <li><a href="reviews.php" id="mainmenu3" accesskey="3" title="" class="link1 vline">Reviews</a></li>
  132.                                         <li><a href="articles.php" id="mainmenu4" accesskey="4" title="" class="link1 vline">Articles</a></li>
  133.                                         <li><a href="details.php" id="mainmenu5" accesskey="5" title="" class="link1 vline">Staff</a></li>
  134.                                         <li><a href="contact.php" id="mainmenu6" accesskey="6" title="" class="link1 vline">Contact</a></li>
  135.                                 </ul>
  136.                                 <p class="text1" style="width: 200px; float: right; margin: 0px 15px 0 0;"><script language="JavaScript" type="text/javascript" src="date.js"></script></p>
  137.                         </div>
  138.                         <!-- Begin Main Content -->
  139.                         <div class="two-col">
  140.                                 <div class="colA">
  141.                                         <div id="box1">
  142.                                         <h2 class="text2 title1">LostNation Links</h2>
  143.                                         <ul class="ul1">
  144.                                         <li><span class="bbit-li-info"><a href="login.php">Login</a></span></li>
  145.                                         <li><span class="bbit-li-info"><a href="register.php">Register</a></span></li>
  146.                                         <li><span class="bbit-li-info"><a href="resend.php">Lost Password</a></span></li>
  147.                                         <li><span class="bbit-li-info"><a href="tos.php">Terms of Service</a></span></li>
  148.                                         <li><span class="bbit-li-info"><a href="policy.php">Privacy Policy</a></span></li>
  149.                                         <li><span class="bbit-li-info"><a href="preview.php">Preview</a></span></li>
  150.                                 </ul>
  151.                                 <div class="boxfoot">
  152.                             <!-- # -->
  153.                 </div>
  154.                                 </div>
  155.                                 </div>
  156.                                 <div class="colB">
  157.                                 <div id="box5">
  158.                                 <div class="notice-donate">LostNation Registration</div>
  159. EOF;
  160. $ip = ($_SERVER['REMOTE_ADDR']);
  161. if (file_exists('ipbans/' . $ip)) {
  162.     die(
  163.             "<b><span style='color: red; font-size: 120%'>
  164.            Your IP has been banned, there is no way around this.
  165.            </span></b>
  166.            </body></html>");
  167. }
  168. if ($_POST['username']) {
  169.  
  170.     if (!$_SESSION['captcha'] or $_SESSION['captcha'] != $_POST['captcha']) {
  171.         unset($_SESSION['captcha']);
  172.         print "Captcha Test Failed
  173. &gt;<a href='register.php'>Back</a>";
  174.         exit();
  175.     }
  176.  
  177.     unset($_SESSION['captcha']);
  178. }
  179. if ($_POST['username']) {
  180.     $sm = 100;
  181.     if ($_POST['promo'] == "Your Promo Code Here") {
  182.         $sm += 100;
  183.     }
  184.  
  185.     $class = mysql_query("SELECT className, money, crystals, strength, guard, agility, iq, labor FROM player_class WHERE classID = {$_POST['classID']}");
  186.     if (mysql_num_rows($class)) {
  187.         $c = mysql_fetch_array($class);
  188.         $money = $c["money"] + $sm;
  189.         $crystals = $c["crystals"];
  190.         $strength = $c["strength"];
  191.         $guard = $c["guard"];
  192.         $agility = $c["agility"];
  193.         $iq = $c["iq"];
  194.         $labor = $c["labor"];
  195.     } else {
  196.         $crystals = 10;
  197.         $strength = 10;
  198.         $guard = 10;
  199.         $agility = 10;
  200.         $iq = 10;
  201.         $labor = 10;
  202.     }
  203.  
  204.     $username = $_POST['username'];
  205.     $username = str_replace(array("<", ">"), array("&lt;", "&gt;"), $username);
  206.     $q = mysql_query("SELECT * FROM users WHERE username='{$username}' OR login_name='{$username}'");
  207.     $q2 = mysql_query("SELECT * FROM users WHERE email='{$_POST['email']}'");
  208.  
  209.     if (strlen($_POST['username']) < 6) {
  210.         print "Sorry, the username is too short.
  211. &gt;<a href='register.php'>Back</a>";
  212.     } else if (strlen($_POST['username']) > 15) {
  213.         print "Sorry, the username is too large.
  214. &gt;<a href='register.php'>Back</a>";
  215.     } else if (mysql_num_rows($q)) {
  216.         print "Username already in use. Choose another.
  217. &gt;<a href='register.php'>Back</a>";
  218.     } else if (!preg_match("/^[ a-zA-Z0-9]*$/", trim($_POST['username']))) {
  219.         print "Your username contained characters that aren't allowed. Only A-Z, 0-9 and spaces accepted.
  220. &gt;<a href='register.php'>Back</a>";
  221.     } else if (mysql_num_rows($q2)) {
  222.         print "E-Mail already in use. Choose another.
  223. &gt;<a href='register.php'>Back</a>";
  224.     } else if (strlen($_POST['password']) < 6) {
  225.         print "Your password is too small.
  226. &gt;<a href='register.php'>Back</a>";
  227.     } else if ($_POST['password'] != $_POST['cpassword']) {
  228.         print "The passwords did not match, go back and try again.
  229. &gt;<a href='register.php'>Back</a>";
  230.     } else {
  231.         $_POST['ref'] = abs((int) $_POST['ref']);
  232.         $IP = $_SERVER['REMOTE_ADDR'];
  233.         $q = mysql_query("SELECT * FROM users WHERE lastip='$IP' AND userid={$_POST['ref']}");
  234.         if (mysql_num_rows($q)) {
  235.             die("No creating referral multies. Bad dog.
  236. &gt;<a href='register.php'>Back</a>");
  237.         }
  238.         if ($_POST['ref'] > 0) {
  239.             $ref = mysql_query("SELECT * FROM users WHERE userid={$_POST['ref']}");
  240.             if (!mysql_num_rows($ref)) {
  241.                 die("Your adding a non existent refer
  242. &gt;<a href='register.php'>Back</a>");
  243.             }
  244.         }
  245.  
  246.  
  247.  
  248.  
  249.  
  250.  
  251.  
  252.  
  253.         $r = mysql_fetch_array($q);
  254.     }
  255.     mysql_query("INSERT INTO users (username, login_name, userpass, level, money, crystals, donatordays, user_level, energy, maxenergy, will, maxwill,
  256. brave, maxbrave, hp, maxhp, location, gender, signedup, email, bankmoney, lastip, lastip_signup,player_class) VALUES( '{$username}', '{$username}',
  257. md5('{$_POST['password']}'), 1, $money, $crystals, 0, 1, 12, 12, 100, 100, 5, 5, 100, 100, 1, '{$_POST['gender']}', unix_timestamp(), '{$_POST['email']}',
  258. -1, '$IP', '$IP','{$_POST['classID']}')");
  259.  
  260.  
  261.     $i = mysql_insert_id($c);
  262.     mysql_query(
  263.             "INSERT INTO userstats VALUES($i, $strength, $agility, $guard, $labor, $iq)", $c);
  264.  
  265.  
  266.     if ($_POST['ref']) {
  267.         mysql_query(
  268.                 "UPDATE `users`
  269.                    SET `crystals` = `crystals` + 2
  270.                    WHERE `userid` = {$_POST['ref']}");
  271.         event_add($_POST['ref'], "For refering $username to the game, you have earnt 2 valuable crystals!", $c);
  272.         $e_rip = mysql_real_escape_string($rem_IP, $c);
  273.         $e_oip = mysql_real_escape_string($ip, $c);
  274.         mysql_query(
  275.                 "INSERT INTO `referals`
  276.                    VALUES(NULL, {$_POST['ref']}, $i, " . time()
  277.                 . ", '{$e_rip}', '$e_oip')", $c);
  278.     }
  279.     print
  280.             "You have signed up, enjoy the game.
  281. &gt; <a href='login.php'>Login</a>";
  282. } else {
  283.     $gref = abs((int) $_GET['REF']);
  284.     $fref = $gref ? $gref : '';
  285.  
  286.  
  287.  
  288.     $chars =
  289.             "1234567890";
  290.     $len = strlen($chars);
  291.     $_SESSION['captcha'] = "";
  292.     for ($i = 0; $i < 4; $i++)
  293.         $_SESSION['captcha'] .= $chars[rand(0, $len - 1)];
  294.  
  295.  
  296.  
  297.  
  298.     echo"
  299.  
  300.  
  301.  
  302.  
  303.  
  304.  
  305. <center><div style='background-color:#222222; text-align: left; color:white; padding-left: 10px; width:75%; border:1px solid #EEEEEE'>
  306.        <small><b><h3><u><b>Register:</b></u></h3>
  307.            Its never been easier to sign up and register an account.
  308.            Registration is free and within just a few minutes you can being joining the ultimate RPG gaming experience.Just complete the fields below.
  309.                Fields marked <font size = 3 color = red>*</font> are to be completed:
  310.    </div>
  311.    </center>
  312.  
  313.  
  314.  
  315.  
  316.  
  317.  
  318.  
  319. <form action='register.php' method='post'>
  320. <table width='75%' class='table' cellspacing='1'>
  321. <tr>  
  322.  
  323.  
  324. <td><font color = red>*</font> Username:</td><td><center><input type='text' name='username' /></center></td>
  325. </tr>
  326. <tr>
  327. <td><font color = red>*</font> Password:</td><td><center><input type='password' name='password' /></center></td>
  328. </tr>
  329. <tr>
  330. <td><font color = red>*</font> Confirm Password:</td><td><center><input type='password' name='cpassword' /></center></td>
  331. </tr>
  332. <tr>
  333. <td><font color = red>*</font> Email:</td><td><center><input type='text' name='email' /></center></td>
  334. </tr>
  335. <tr>
  336. <td><font color = red>*</font> Confirm Email:</td><td><center><input type='text' name='cemail' /></center></td>
  337. </tr>
  338. <tr>
  339. <td>Promo Code:</td><td><center><input type='text' name='promo' /></center></td>
  340. </tr>
  341. <tr>
  342. <td>Player Class:</td><td><center>" . class_dropdown(NULL, "classID") . "</td></center>
  343. </tr>
  344. <tr>
  345. <td><img src='captcha.php?bgcolor=C3C3C3' width='200' height='50'  /></td><td><input type='text' name='captcha' /></td>
  346. </tr>
  347. <tr>
  348. <td colspan= '2'><center><input type='submit' value='Submit' /></center></td>
  349.  
  350. </form></table>
  351.  
  352. <center><div style='background-color:#222222; text-align: left; color:white; padding-left: 10px; width:75%; border:1px solid #EEEEEE'>
  353.        <small><b><h3><u><b>Disclaimer:</b></u></h3>When registering an account you accept all Terms of Service & Privacy Policy. In addition you are required to comply with all ingame rules. If you disagree with any of the Terms of Service / Privacy Policy or Game Rules at anytime you should terminate all use of your account and contact accounts@LostNation.net and request that your account be deleted.
  354.    </div>
  355.    </center>
  356.  
  357.  
  358.  
  359.  
  360.  
  361.  
  362.  
  363. <hr width = 75%><center>&gt; <a href='login.php'>Login</a><hr width = 75%></center>";
  364. }
  365.  
  366. print '
  367.                        </div>
  368.                            </div>
  369.                        </div>
  370.                        <div id="login-wrapperB" $ie6_fix></div>
  371.                        <br style="clear: both;" />
  372.                        </div>
  373.                </div>
  374.            </div>
  375.    <div id="footer"><p class="style2">Game Copyright &copy;{$year} Dragon Blade. All rights reserved worldwide.</center></i></p></div>
  376. </div>
  377. </body>
  378. </html>
  379. ';
  380. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement