Raised This Month: $ Target: $400
 0% 

[PHP] Login Help


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
shuttle_wave
Veteran Member
Join Date: Apr 2009
Location: New Zealand
Old 10-08-2010 , 20:31   Re: [PHP] Login Help
Reply With Quote #5

PHP Code:
<?php include("header.php"); ?>

<?php
$User 
"Shuttle_Wave";
$Pass "test";
?>

<center>

<h1>Admin Login Panel</h1>


<form action='#' method='post'>

Username: <input type="text" name="username" id="username" />
Password: <input type="password" name="password" id="password" />
<input type="submit" name="Submit" value="Login" /></form>

</center>

<?php 

if(isset($_POST["username"]) && isset($_POST["password"])) 

    if(
$_POST["username"] == $User && $_POST["password"] == $Pass
    { 
        
session_register("username");
        
session_register("password");
        
header("location:system.php");
    } 
    else 
    { 
        echo 
"Incorrect Username or Password"
    } 


?>

<body>
</body>
</html>
i did that. it wrks but when i enter the correct user and password i get this error

PHP Code:
Warningsession_register() [function.session-register]: Cannot send session cookie headers already sent by (output started at C:\xampp\htdocs\header.php:12in C:\xampp\htdocs\login.php on line 27

Warning
session_register() [function.session-register]: Cannot send session cache limiter headers already sent (output started at C:\xampp\htdocs\header.php:12in C:\xampp\htdocs\login.php on line 27

Warning
Cannot modify header information headers already sent by (output started at C:\xampp\htdocs\header.php:12in C:\xampp\htdocs\login.php on line 29 

codes below is my system.php

PHP Code:
<?php include("header.php"); ?>
<?php 
include("databases.php"); ?>

<?
session_start
();
 
if(!
session_is_registered(username))
{
  
header("location:login.php");
}
?>

<center>

<h1>Login System Information</h1>

<?php

echo "<table border='1'>
    <tr class=\"table_head\">
        <th class=\"number\" style=\"min-width:20px;\">#</th>
        <th>&nbsp; Name &nbsp;</th>
        <th>&nbsp; UserName &nbsp;</th>
        <th>&nbsp; Password &nbsp;</th>
        <th>&nbsp; Status &nbsp;</th>
    </tr>"
;
    
    while(
$row mysql_fetch_array($result))
    {
        echo 
"<tr>";
        echo 
"<td class=\"number\">&nbsp;" $row['num'] .  "&nbsp;</td>";
        echo 
"<td class=\"center\">&nbsp;" $row['name'] . "&nbsp;</td>";
        echo 
"<td class=\"center\">&nbsp;" $row['username'] . "&nbsp;</td>";
        echo 
"<td class=\"center\">&nbsp;" $row['password'] . "&nbsp;</td>";
        echo 
"<td class=\"center\">&nbsp;" $row['status'] . "&nbsp;</td>";
        
        echo 
"</tr>";
    }

echo 
"</table>";

mysql_close($database);
?>

</center>

<body>
</body>
</html>
__________________
JailBreak Mod with Plugin API ( 90% ) Public
shuttle_wave is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 09:26.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode