hallo ik heb een login script gemaakt maar het wil niet werken ik wilvan mijn index3 naar die andere index en daar moet hij ingelogd zijn alleen dat doet hij niet hij geeft error hier is de code van mijn index3

<?
error_reporting(E_ALL);
session_start();

include("config.php");
include("functions.php");

if(!isset($_COOKIE['last_active']))
{
if(isset($_SESSION['user_id']))
{
mysql_query("UPDATE tbl_users SET user_lastactive = NOW() WHERE user_id = '" . $_SESSION['user_id'] . "'") or die(mysql_error());
setcookie("last_active",true,time()+5);
}
}

if(!isset($_SESSION['user_id']))
{
if(isset($_POST['login']))
{
$query = mysql_query("SELECT * FROM tbl_users WHERE user_name = '" . $_POST['user'] . "' AND user_pass = '" . md5($_POST['pass']) . "'");
$result = mysql_num_rows($query);

if(empty($result))
{
echo "<script>alert('Login Incorrect.'); document.location.href=('index%203.htm')</script>";
}
else
{
while($row = mysql_fetch_assoc($query))
{
$user_id = $row['user_id'];
}

header("Location: index%203.htm");
$_SESSION['user_id'] = $user_id;
}
}
else
{
?>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- saved from url=(0035)http://www.geocities.com/amhix2000/ -->
<HTML><HEAD><TITLE>Title Here</TITLE>
<META http-equiv=Content-Type content="text/html; charset=windows-1252">
<META content="Put text here" name=classification>
<META content="Your name" name=Author>
<META content="Layout is Copyright © http://www.gnext.vze.com"; name=copyright>
<META content="Your Keywords here" name=keywords>
<META content="Your Site Description here" name=description>
<STYLE type=text/css>A:link {
COLOR: #ffffff; TEXT-DECORATION: none
}
A:visited {
COLOR: #ffffff; TEXT-DECORATION: none
}
A:active {
COLOR: #ffffff
}
A:hover {
COLOR: #ffffff; TEXT-DECORATION: underline overline
}
BODY {
SCROLLBAR-FACE-COLOR: #1b294c; SCROLLBAR-HIGHLIGHT-COLOR: #1b294c; SCROLLBAR-SHADOW-COLOR: #ffffff; SCROLLBAR-3DLIGHT-COLOR: #ffffff; SCROLLBAR-ARROW-COLOR: #ffffff; SCROLLBAR-TRACK-COLOR: #1b294c; SCROLLBAR-DARKSHADOW-COLOR: #1b294c; BACKGROUND-COLOR: #1b294c
}
</STYLE>

<SCRIPT language=JavaScript1.2>
//Gradual-Highlight image script- By Dynamic Drive
//For full source code and more DHTML scripts, visit http://www.dynamicdrive.com
//This credit MUST stay intact for use
function high(which2){
theobject=which2
highlighting=setInterval("highlightit(theobject)",50)
}
function low(which2){
clearInterval(highlighting)
if (which2.style.MozOpacity)
which2.style.MozOpacity=0.3
else if (which2.filters)
which2.filters.alpha.opacity=30
}
function highlightit(cur2){
if (cur2.style.MozOpacity<1)
cur2.style.MozOpacity=parseFloat(cur2.style.MozOpacity)+0.1
else if (cur2.filters&&cur2.filters.alpha.opacity<100)
cur2.filters.alpha.opacity+=10
else if (window.highlighting)
clearInterval(highlighting)
}
</SCRIPT>

<META content="Microsoft FrontPage 5.0" name=GENERATOR></HEAD>
<BODY text=white background=index_bestanden/layoutbg.jpg>
<DIV id=Layer1
style="Z-INDEX: 1; LEFT: 0px; WIDTH: 750px; POSITION: absolute; TOP: 0px">
<IMG
src="index_bestanden/mainlay.jpg" width="750" height="227"></DIV>
<DIV></DIV>
<DIV align=left>
<DIV id=Layer2
style="Z-INDEX: 5; LEFT: 5px; WIDTH: 120px; POSITION: absolute; TOP: 155px; HEIGHT: 115px"><FONT
face=verdana color=#336699 size=1>
<P><STRONG>. : MAIN : .</STRONG><BR><A
href="http://www.geocities.com/amhix2000/">Home</A><BR><A
href="http://www.geocities.com/amhix2000/">Contact Us</A><BR><A
href="http://www.geocities.com/amhix2000/">Affiliation</A><BR><A
href="http://www.geocities.com/amhix2000/">Link To Us</A><BR><A
href="http://www.geocities.com/amhix2000/">Advertise</A></P>;
<P><STRONG>. : TITLE HERE : .</STRONG><BR><A
href="http://www.geocities.com/amhix2000/">Link Here</A><BR><A
href="http://www.geocities.com/amhix2000/">Link Here</A><BR><A
href="http://www.geocities.com/amhix2000/">Link Here</A><BR><A
href="http://www.geocities.com/amhix2000/">Link Here</A><BR><A
href="http://www.geocities.com/amhix2000/">Link Here</A><BR><A
href="http://www.geocities.com/amhix2000/">Link Here</A></P>
<P><STRONG>. : TITLE HERE : .</STRONG><BR><A
href="http://www.geocities.com/amhix2000/">Link Here</A><BR><A
href="http://www.geocities.com/amhix2000/">Link Here</A><BR><A
href="http://www.geocities.com/amhix2000/">Link Here</A><BR><A
href="http://www.geocities.com/amhix2000/">Link Here</A><BR><A
href="http://www.geocities.com/amhix2000/">Link Here</A><BR><A
href="http://www.geocities.com/amhix2000/">Link Here</A></P></FONT></DIV></DIV>
<DIV id=Layer4
style="Z-INDEX: 4; LEFT: 605px; WIDTH: 140px; POSITION: absolute; TOP: 155px; HEIGHT: 115px"><FONT
face=verdana color=#336699 size=1>
<P><STRONG>. : LOG IN : .</STRONG><BR>

<form method="POST">
<input type="hidden" value="1" name="login">
Username : <input type="text" name="user" maxlength="15" size="20"><br>
Password : <input type="password" name="pass" maxlength="15" size="20"><br><br>

<input type="Submit" value="Login"><br><br>
<img src="icons/admin.gif"> <a href="admin.php">Admin Login</a><br>
<img src="icons/register.gif"> <a href="register.php">Register</a><br>
<img src="icons/memberlist.gif"> <a href="memberlist.php">Memberlist</a>

 <P><STRONG>. : TOPSITES : .</STRONG><BR><A
href="http://www.geocities.com/amhix2000/">Link Here</A><BR><A
href="http://www.geocities.com/amhix2000/">Link Here</A><BR><A
href="http://www.geocities.com/amhix2000/">Link Here</A><BR><A
href="http://www.geocities.com/amhix2000/">Link Here</A><BR><A
href="http://www.geocities.com/amhix2000/">Link Here</A><BR><A
href="http://www.geocities.com/amhix2000/">Link Here</A><BR><A
href="http://www.geocities.com/amhix2000/">Link Here</A><BR><A
href="http://www.geocities.com/amhix2000/">Link Here</A><BR><A
href="http://www.geocities.com/amhix2000/">Link Here</A><BR><A
href="http://www.geocities.com/amhix2000/">Link Here</A></P>
<CENTER>
<p></p>
</CENTER></FONT></DIV>
<DIV id=Layer5
style="Z-INDEX: 4; LEFT: 180px; WIDTH: 450px; POSITION: absolute; TOP: 53px; HEIGHT: 300px"><FONT
face=verdana color=#336699 size=1><A
href="http://www.geocities.com/amhix2000/"><IMG onmouseover=high(this)
style="FILTER: alpha(opacity=55); moz-opacity: 1.5" onmouseout=low(this)
height=60 alt="AMPHIX: a DOD and Counterstrike Clan"
src="index_bestanden/adbanner.jpg" width=468 border=0> </FONT></DIV></A>
<DIV></DIV>
<DIV id=Layer5
style="Z-INDEX: 4; LEFT: 151px; WIDTH: 440px; POSITION: absolute; TOP: 165px; HEIGHT: 300px"><FONT
face=verdana color=#ffffff size=1>
<TABLE borderColor=#8da2ba width="100%" border=0>
<TBODY>
<TR>
<TD><FONT face=verdana color=#ffffff size=1><STRONG>Welcome to AMHIX: CS
and DOD Clan</STRONG></FONT></TD></TR>
<TR>
<TD><FONT face=verdana color=#336699 size=1>
<P><BR>
<CENTER><STRONG>main page here</CENTER></STRONG>
<P></P>
<P></P></FONT></TD></TR></TBODY></TABLE><BR><BR>
<DIV>
<TABLE borderColor=#336699 width="100%" border=0>
<TBODY>
<TR>
<TD><FONT face=verdana color=#336699 size=1>Website ©copyright 2004 AMHIX
clan. All Rights Reserved<BR><A href="http://www.quickness.uni.cc/">;
<IMG
onmouseover=high(this) style="FILTER: alpha(opacity=55); moz-opacity: 1.5"
onmouseout=low(this) alt="Layout By GeneratioNext"
src="index_bestanden/gnext.gif" border=0 width="88" height="11"> </FONT>
<DIV></DIV></A></TD></TD></TR></TBODY></TABLE><BR><BR></FONT></DIV></FONT></B>
<CENTER>
<p></p>
</CENTER></FONT></B>
<CENTER>
<p></p>
</CENTER><!-- text below generated by server. PLEASE REMOVE --></OBJECT></LAYER></DIV></SPAN></STYLE></NOSCRIPT></TABLE></SCRIPT></APPLET>
<SCRIPT
language=JavaScript>var PUpage="76001080"; var PUprop="geocities"; </SCRIPT>

<SCRIPT language=JavaScript src="index_bestanden/pu5geo.js"></SCRIPT>

<SCRIPT language=JavaScript src="index_bestanden/ygIELib9.js"></SCRIPT>

<SCRIPT language=JavaScript>var yviContents='http://us.toto.geo.yahoo.com/toto?s=76001080&l=NE&b=1&t=1091743499';yviR='us';yfiEA(0);</SCRIPT>

<SCRIPT language=JavaScript src="index_bestanden/mc.js"></SCRIPT>

<SCRIPT language=JavaScript src="index_bestanden/geov2.js"></SCRIPT>

<SCRIPT language=javascript>geovisit();</SCRIPT>
<NOSCRIPT><IMG height=1 alt=setstats src="index_bestanden/visit.gif" width=1
border=0></NOSCRIPT> <IMG height=1 alt=1 src="index_bestanden/serv.gif" width=1>
</BODY></HTML>

<?
}
}
else
{
$query = mysql_query("SELECT * FROM tbl_users WHERE user_id = '" . $_SESSION['user_id'] . "'");

while($row = mysql_fetch_assoc($query))
{
echo "Username : <b>" . $row['user_name']. "</b>";

if($row['user_pm'])
{
$msg = mysql_result(mysql_query("SELECT COUNT(1) FROM tbl_msg WHERE msg_to = '" . $_SESSION['user_id'] . "'"),0);

if(empty($msg))
{
$msg = "<font color=\"#008000\">Empty</font>";
}
elseif($msg >= $cfg['max_msg'])
{
$msg = "<font color=\"#FF0000\">FULL</font>";
}
else
{
$msg = $msg . " / " . $cfg['max_msg'];
}

echo "<br>\n";
echo "Inbox : <b>". $msg ."</b> (
<a href=%22msg.php?act=inbox/">Open</a> )";
}
}

echo "<br>\n<br>\n";

if(isset($_SESSION['admin_login']))
{

echo "";
echo "<br>\n";
}

echo "<img src=%22icons/memberlist.gif/%22> <a href=%22memberlist.php/%22>Memberlist</a>";
echo "<br>\n";
echo "<img src=%22icons/profile.gif/%22>
<a href=%22profile.php?act=edit_profile/">Change Profile</a>";
echo "<br>\n";
echo "<img src=%22icons/profile.gif/%22>
<a href=%22profile.php?act=view&user_id=" . $_SESSION['user_id'] . "\">My Profile</a>";
echo "<br>\n";
echo "<img src=%22icons/logoff.gif/%22> <a href=%22logoff.php/%22>Log Off</a>";
}
?></form>

en hier moet hij naar toe en dan de user ingelogd zijn

<?
error_reporting(E_ALL);
session_start();

include("config.php");
include("functions.php");

if(!isset($_COOKIE['last_active']))
{
if(isset($_SESSION['user_id']))
{
mysql_query("UPDATE tbl_users SET user_lastactive = NOW() WHERE user_id = '" . $_SESSION['user_id'] . "'") or die(mysql_error());
setcookie("last_active",true,time()+5);
}
}

if(!isset($_SESSION['user_id']))
{
if(isset($_POST['login']))
{
$query = mysql_query("SELECT * FROM tbl_users WHERE user_name = '" . $_POST['user'] . "' AND user_pass = '" . md5($_POST['pass']) . "'");
$result = mysql_num_rows($query);

if(empty($result))
{
echo "<script>alert('Login Incorrect.'); document.location.href=('index.php')</script>";
}
else
{
while($row = mysql_fetch_assoc($query))
{
$user_id = $row['user_id'];
}

header("Location: index.php");
$_SESSION['user_id'] = $user_id;
}
}
else
{
?>
<h1>Log In</h1>
<form method="POST">
<input type="hidden" value="1" name="login">
Username : <input type="text" name="user" maxlength="15" size="20"><br>
Password : <input type="password" name="pass" maxlength="15" size="20"><br><br>

<input type="Submit" value="Login"><br><br>
<img src="icons/admin.gif"> <a href="admin.php">Admin Login</a><br>
<img src="icons/register.gif"> <a href="register.php">Register</a><br>
<img src="icons/memberlist.gif"> <a href="memberlist.php">Memberlist</a>

<?
}
}
else
{
$query = mysql_query("SELECT * FROM tbl_users WHERE user_id = '" . $_SESSION['user_id'] . "'");

while($row = mysql_fetch_assoc($query))
{
echo "Username : <b>" . $row['user_name']. "</b>";

if($row['user_pm'])
{
$msg = mysql_result(mysql_query("SELECT COUNT(1) FROM tbl_msg WHERE msg_to = '" . $_SESSION['user_id'] . "'"),0);

if(empty($msg))
{
$msg = "<font color=\"#008000\">Empty</font>";
}
elseif($msg >= $cfg['max_msg'])
{
$msg = "<font color=\"#FF0000\">FULL</font>";
}
else
{
$msg = $msg . " / " . $cfg['max_msg'];
}

echo "<br>\n";
echo "Inbox : <b>". $msg ."</b> ( <a href=\"msg.php?act=inbox\">Open</a> )";
}
}

echo "<br>\n<br>\n";

if(isset($_SESSION['admin_login']))
{

echo "";
echo "<br>\n";
}

echo "<img src=\"icons/memberlist.gif\"> <a href=\"memberlist.php\">Memberlist</a>";
echo "<br>\n";
echo "<img src=\"icons/profile.gif\"> <a href=\"profile.php?act=edit_profile\">Change Profile</a>";
echo "<br>\n";
echo "<img src=\"icons/profile.gif\"> <a href=\"profile.php?act=view&user_id=" . $_SESSION['user_id'] . "\">My Profile</a>";
echo "<br>\n";
echo "<img src=\"icons/logoff.gif\"> <a href=\"logoff.php\">Log Off</a>";
}
?>

srry van mijn niet goede uitleg want ik weet niet hoe ik het uit moet leggen.

Reageren