Ok then, I now have a working stripped down version, yay! It's a login form on a blank page, and its actually working in conjunction with my registration page
Unfortunately when I attempt to put this working login system into my actual webpage, im back to the whole:
Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at C:\xampplite\phpMyAdmin\new\edit.php:7) in C:\xampplite\phpMyAdmin\new\edit.php on line 165
Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at C:\xampplite\phpMyAdmin\new\edit.php:7) in C:\xampplite\phpMyAdmin\new\edit.php on line 165
Code: Select all
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<meta http-equiv="Content-Language" content="en-us" />
<meta name="robots" content="all" />
<meta name="author" content="Luka Cvrk (http://www.solucija.com)" />
<meta name="Copyright" content="" />
<meta name="description" content="" />
<meta name="keywords" content="" />
<link href="images/style.css" rel="stylesheet" type="text/css" />
<title>Imperial-Base.com</title>
<SCRIPT language=JavaScript type=text/javascript>
<!--
if (document.images) {
nav1on = new Image(); nav1on.src = "images/trooperhead.png";
nav2on = new Image(); nav2on.src = "images/trooperarmleft.png";
nav3on = new Image(); nav3on.src = "images/trooperarmright.png";
nav4on = new Image(); nav4on.src = "images/trooperbody.png";
nav5on = new Image(); nav5on.src = "images/trooperlegs.png";
navoff = new Image(); navoff.src = "images/troopersized.png";
}
function rollOn(img1,img2,text){
str = "window.status = '" + text + "'";
if (document.all) setTimeout(str,5); // this is a hack to fix bug in IE on PC
else window.status = text;
if (document.images) {
document.navs.src=eval(img1 + "on.src");
}
}
function rollOff(){
window.status = "";
if (document.images) {
document.navs.src=navoff.src;
}
}
//-->
</SCRIPT>
</head>
<body>
<div id="wrap">
<div id="container">
<div id="header">
<p> </p>
</div>
<div id="hmenu"> <a href="index.html">Home</a> <a href="products.html">Products</a>
<a href="contact.html">Contact</a> <a href="catalogue.html">Catalogue</a>
<a href="sitemap.php">Sitemap</a> <a href="login.html">Login/Register</a><a href="#">
Blank</a> </div>
<div id="left_column">
<div id="menu"> <a href="index.html" accesskey="h" title="Accesskey: H"><span class="underline">H</span>OME<span class="white">Go
to homepage</span></a> <a href="products.html" accesskey="n" title="Accesskey: N"><span class="underline">PRODUCTS</span><span class="white"><font color="#FFFFFF">See
our Products</font></span></a> <a href="contact.html" accesskey="p" title="Accesskey: P"><span class="underline">CONTACT</span><span class="white"><font color="#FFFFFF">Contact
Us </font></span></a> <a href="catalogue.html" accesskey="s" title="Accesskey: S"><span class="underline">CATALOGUE</span><span class="white"><font color="#FFFFFF">Request
Catalogue </font></span></a> <a href="sitemap.php" accesskey="a" title="Accesskey: A"><span class="underline">SITEMAP</span><span class="white"><font color="#FFFFFF">View
our Sitemap</font></span></a> <a href="#" accesskey="c" title="Accesskey: C"><span class="underline">EMPTY</span><span class="white">Empty</span></a>
<script language="JavaScript">
function openDir( form ) {
var newIndex = form.fieldname.selectedIndex;
if ( newIndex == 0 ) {
alert( "Please select a location!" );
} else {
cururl = form.fieldname.options[ newIndex ].value;
window.location.assign( cururl );
}
}
</script>
<form name=form>
<tr>
<td nowrap>
<select name="fieldname" size="1"
onChange="openDir( this.form )">
<option>Jump To </option>
<option value=index.html>Home</option>
<option value=products.html>Products</option>
<option value=contact.html>Contact</option>
<option value=catalogue.html>Catalogue</option>
<option value=sitemap.php>Sitemap</option>
</select>
</td>
</tr>
</form>
</div>
<p>
<img src="images/troopersized.png" name=navs width=100 height=240 border=0 align="absmiddle" usemap="#map1">
<map name="map1">
<area shape="poly" coords="69,18,67,38,46,38,30,30,36,-7,33,9,55,-4,58,-1,65,4" href="#" target="_self" alt="head"
onMouseOver="rollOn('nav1','target1','head'); return true;"
onMouseOut="rollOff(); return true;" />
<area shape="poly" coords="29,38,68,40,71,47,73,66,70,100,29,100,28,56,26,51" href="#" target="_self" alt="body"
onMouseOver="rollOn('nav4','target4','body'); return true;"
onMouseOut="rollOff(); return true;" />
<area shape="poly" coords="67,109,93,238,63,238,61,195,49,136,38,182,32,237,3,237,10,204,24,126,35,111,49,129" href="#" target="_self" alt="trooperlegs"
onMouseOver="rollOn('nav5','target3','trooperlegs'); return true;"
onMouseOut="rollOff(); return true;" />
<area shape="poly" coords="29,28,26,46,25,64,19,70,22,79,20,130,20,87,12,133,-1,91,6,75,3,58,3,48,7,38,12,33" href="#" target="_self" alt="leftarm"
onMouseOver="rollOn('nav2','target2','leftarm'); return true;"
onMouseOut="rollOff(); return true;" />
<area shape="poly" coords="71,31,94,35,95,135,78,135" href="#" target="_self" alt="rightarm"
onMouseOver="rollOn('nav3','target2','rightarm'); return true;"
onMouseOut="rollOff(); return true;" />
</map>
</p>
</div>
<div id="right_column">
<div class="main_article">
<h3>Sitemap<span class="red"></span></h3>
</p>
<?php
//Start - so we can use session variables
session_start();
// Check if we have already created a authenticated session
if (isset($_SESSION["authenticatedUser"]))
{
$_SESSION["message"] = "You are already logged in as ". $_SESSION['authenticatedUser'];
//Redirect to the login page
header("Location: admin.php");
}
else
{
// No session established, no POST variables
//Display the login page
?>
<?php
// Include the formatted error message
if (isset($_SESSION['message']))
echo
"<h3><font color=red>".$_SESSION['message']."</font></h3>";
// Generate the login <form> layout
?>
</p>
<form method="post" action="loginaction.php">
User-name:
<input type="text" size=10
maxlength=10
name="formUsername">
Password:<
<input type="password" size=10
maxlength=10
name="formPassword">
<input name="submit" type="submit" value="Log in">
</form>
<?php
}
?>
<p> </p>
<p> </p>
</div>
</div>
</div>
<div id="footer"> <a href="contact.html">Contact</a> - <a href="copyright.html" target="_blank">Copyright</a> - <a href="privacy.html" target="_blank">Privacy
and Accessibility</a></div>
</div>
</body>
</html>