Advertisement
Guest User

Untitled

a guest
Oct 7th, 2017
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 3.41 KB | None | 0 0
  1. <?php include("servervariables.php");  include('database.php');
  2. ?>
  3. <html>
  4. <head>
  5. <meta http-equiv="content-type" content="text/html; charset=utf-8" />
  6. <title><?php echo SERVERNAME;?></title>
  7. <meta name="keywords" content="" />
  8. <meta name="description" content="" />
  9. <link href="default.css" rel="stylesheet" type="text/css" />
  10. </head>
  11. <body>
  12. <div id="header">
  13.     <h1><?php echo SERVERNAME;?></h1>
  14.     <h2><?php echo SLOGAN;?></h2>
  15. </div>
  16. <div id="left">
  17.     <div id="menu" class="boxed">
  18.         <h2 class="heading">Pages</h2>
  19.         <ul>
  20.             <li class="first"><a href="index.php" title="">Home</a></li>
  21.             <li><a href="stats.php" title="">Player Stats</a></li>
  22.             <li><a href="admins.php" title="">Admins</a></li>
  23.             <li><a href="register.php" title="">Register</a></li>
  24.             <li><?php echo'<a href="login.php?l=a" title="">Admin Control Panel</a>';?></li>
  25.             <li><?php echo'<a href="login.php" title="">User Control Panel</a>';?></li>
  26.             <?php if(defined("FORUMURL")) echo "<li><a href='FORUMURL'>Forums</a></li>"; else echo  "<p>&nbsp;</p>";?>
  27.         </ul>
  28.       <p>&nbsp;</p>
  29.       <p>&nbsp;</p>
  30.     </div>
  31. </div>
  32. <!-- end #left -->
  33. <div id="right">
  34.     <div class="boxed">
  35.         <h2 class="heading">News</h2>
  36. <p>
  37. <?php
  38. include("news.php");
  39. mysql_close($con);
  40. ?></p>
  41.     </div>
  42. </div>
  43. <!-- end #right -->
  44. <div id="center">
  45.     <div class="boxed">
  46.         <h1 class="heading">Welcome to <?php echo SERVERNAME;?>!
  47.           </h1><center>
  48.             <p>
  49.           <h1>Register </h1>
  50.  
  51. <!-- register -->
  52.  
  53. <?php
  54. /* This code will make a connection with database */
  55. $con=mysql_connect("localhost","root","");
  56.  
  57. /* Now, we select the database */
  58. mysql_select_db("tkadmin");
  59.  
  60. /* Now we will store the values submitted by form in variable */
  61. $username=$_POST['username'];
  62. $pass=$_POST['password'];
  63.  
  64. /* we are now encrypting password while using md5() function */
  65. $password=md5($pass);
  66. $confirm_password=$_POST['confirm_password'];
  67.  
  68. /* Now we will check if username is already in use or not */
  69. $queryuser=mysql_query("SELECT * FROM playerinfo WHERE username='$username' ");
  70. $checkuser=mysql_num_rows($queryuser);
  71. if($checkuser != 0)
  72. { echo "Sorry, ".$username." is already been taken."; }
  73. else {
  74.  
  75. /* now we will check if password and confirm password matched */
  76. if($pass != $confirm_password)
  77. { echo "Password and confirm password fields were not matched"; }
  78. else {
  79.  
  80. /* Now we will write a query to insert user details into database */
  81.  
  82. $insert_user=mysql_query("INSERT INTO playerinfo (username, password, kills, deaths, score, money, IP, adminlvl, email) VALUES ('$username', '$password', 0, 0, 0, 0, '', 0, '')");
  83.  
  84. if($insert_user)
  85. { echo "Registration Succesfull"; }
  86. else
  87. { echo "error in registration".mysql_error(); }
  88.  
  89. /* closing the if else statements */
  90. }}
  91.  
  92. mysql_close($con);
  93. ?>
  94.  
  95. <!--end of register-->
  96.       </center></p>
  97. </div>
  98. </div>
  99. <!-- end #center -->
  100. <div style="clear: both;">&nbsp;</div>
  101. <div id="footer">
  102.     <p id="legal">Copyright <?php echo SERVERNAME;?>. All Rights Reserved. Website created and designed By [HiC]TheKiller and XFlawless. Icons by glyphish.</p>
  103.     <p id="links"><a href="index.php">Home</a> | <a href="stats.php">Stats</a> | <a href="admins.php">Admins</a> | <a href=<?php if(isset($_SESSION['logged'])) echo "adminpage.php"; else echo "login.php?l=a";?>>ACP</a> | <a href=<?php if(isset($_SESSION['logged'])) echo "playerpage.php"; else echo "login.php";?>>UCP</a>  </p>
  104. </div>
  105. </body>
  106. </html>
  107. <? mysql_close($con); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement