- <link href="../templates/default/basic.css" rel="stylesheet" type="text/css" />
- <form id="form1" name="form1" method="post" action="<?php $PHP_SELF; ?>">
- <p align="center" class="tdglobal"><span class="b01"><?php echo $config['site']['title']; ?> UserCP</span></p>
- <table width="200" border="0" align="center" class="liteoption">
- <tr>
- <td width="97" class="right"><div align="left">Username:</div></td>
- <td width="93" class="right"><input name="user" type="text" class="liteoption" id="user" size="15" maxlength="15" /></td>
- </tr>
- <tr>
- <td class="right"><div align="left">Password:</div></td>
- <td class="right"><input name="pass" type="text" class="liteoption" id="pass" size="15" maxlength="15" /></td>
- </tr>
- </table>
- <p align="center" class="tdglobal"><span class="right">
- <input name="submit" type="submit" class="liteoption" id="submit" value="Log In" size="15" maxlength="15" />
- </span></p>
- </form>
- <p align="center" class="tdglobal">
- <?php
- if(isset($_POST['submit'])) {
- $U = $_POST['user'];
- $P = md5($_POST['pass']);
- mysql_connect($cms['db']['host'], $cms['db']['user'], $cms['db']['pass']);
- mysql_select_db($cms['db']['name']);
- $result1 = "SELECT * FROM `accounts` WHERE username='$U' and password='$P' and accesslevel = '100'";
- $query = mysql_query($result1);
- $count = mysql_num_rows($query);
- if($count == 1){
- session_register("User_Name");
- session_register("User_Pass");
- $_SESSION['account'] = $_POST['user'];
- echo('Logged in.... Click <a href=?op=user><strong>here</strong></a>');
- }
- else {
- echo "<strong>Login Failed!</strong>";
- }
- }
- ?>
- <br />
- </p>
This is the login.php: