- <?php
- session_start(); // start up your PHP session!
- require ('config.php');
- ?>
- <br /><br /><div class="formitem" style="width:250px;overflow: hidden;">
- <form id="form1" name="form1" method="post" action="?op=ulogin">
- <p align="center" class="tdglobal"><span class="b01"><?php echo $DynCMS['title']; ?> User Control Panel</span></p>
- <table width="200" border="0" align="center" class="liteoption">
- <tr>
- <td width="97" class="center"><div align="center"><b>Username:</b></div></td>
- <td width="93" class="center"><input name="user" type="text" class="liteoption" id="user" size="15" maxlength="15" /></td>
- </tr>
- <tr>
- <td class="center"><div align="center"><b>Password:</b></div></td>
- <td class="center"><input name="pass" type="password" class="liteoption" id="pass" size="15" maxlength="15" /></td>
- </tr>
- </table>
- <p align="center" class="tdglobal"><span class="center">
- <input name="submit" type="submit" class="liteoption" id="submit" value="Log In" size="15" maxlength="15" />
- </span></p>
- </form>
- <p align="center" class="tdglobal"></div>
- <?php
- if(isset($_POST['submit'])) {
- $U = $_POST['user'];
- $P = md5($_POST['pass']);
- require ('config.php');
- $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=user><strong>here</strong></a>');
- }
- else {
- echo "<strong>Try Again</strong>";
- }
- }
- ?>
- <br />
- </p>
- ------------------------------------------------------------------------------------------------------------------------
Im making a new website layout/design and im getting some errors when i try to login
login.php:
- <?php
- // Make a MySQL Connection
- mysql_connect("localhost", "root", "root") or die(mysql_error());
- mysql_select_db("irose") or die(mysql_error());
- ?>
The problem is when i click "Logged in.... Click here"
i have make it to redirect the users to user.php
and it writes:
[You must log in you noob!]
( I am using some iframes )
When im using a normal login.php from dynastycms
it writes
Warning: session_register() [function.session-register]: Cannot send session cache limiter - headers already sent (output started at C:\AppServ\www\irosetest\web\images\items\login.php:22) in C:\AppServ\www\irosetest\web\images\items\login.php on line 53
Logged in.... Click here
and when i click "Logged in.... Click here " it redirects me again to login.php
(dynasty cms login.php) - edited by me
- */
- ?>
- <form id="form1" name="form1" method="post" action="?op=login">
- <p align="center" class="tdglobal"><span class="b01"><?php echo $DynCMS['title']; ?> User Control Panel</span></p>
- <table width="200" border="0" align="center" class="liteoption">
- <tr>
- <td width="97" class="center"><div align="center"><b>Username:</b></div></td>
- <td width="93" class="center"><input name="user" type="text" class="liteoption" id="user" size="15" maxlength="15" /></td>
- </tr>
- <tr>
- <td class="center"><div align="center"><b>Password:</b></div></td>
- <td class="center"><input name="pass" type="password" class="liteoption" id="pass" size="15" maxlength="15" /></td>
- </tr>
- </table>
- <p align="center" class="tdglobal"><span class="center">
- <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']);
- require("config.php");
- $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>Try Again</strong>";
- }
- }
- ?>
- <br />
- </p>
- --------------------------------------------------------------------------------------------------------
Soo can someone help me ?