Hi
I copied & pasted your code into my "main.php" & the same thing happens - instead of refreshing the "login.php" into goings straight into the main.php?
This is my revised coding with your change >
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<!-- DW6 -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document</title>
<link rel="stylesheet" href="emx_nav_left.css" type="text/css">
<script type="text/javascript">
<!--
var time = 3000;
var numofitems = 7;
//menu constructor
function menu(allitems,thisitem,startstate){
callname= "gl"+thisitem;
divname="subglobal"+thisitem;
this.numberofmenuitems = 7;
this.caller = document.getElementById(callname);
this.thediv = document.getElementById(divname);
this.thediv.style.visibility = startstate;
}
//menu methods
function ehandler(event,theobj){
for (var i=1; i<= theobj.numberofmenuitems; i++){
var shutdiv =eval( "menuitem"+i+".thediv");
shutdiv.style.visibility="hidden";
}
theobj.thediv.style.visibility="visible";
}
function closesubnav(event){
if ((event.clientY <48)||(event.clientY > 107)){
for (var i=1; i<= numofitems; i++){
var shutdiv =eval('menuitem'+i+'.thediv');
shutdiv.style.visibility='hidden';
}
}
}
// -->
</script>
<style type="text/css">
<!--
.style3 {
color: #FF7F00;
font-size: 10px;
}
body {
background-color: #7F7F55;
}
-->
</style>
</head>
<body onmousemove="closesubnav(event);">
<div class="skipLinks">skip to: <a href="#content">page content</a> | <a href="pageNav">links on this page</a> | <a href="#globalNav">site navigation</a> | <a href="#siteInfo">footer (site information)</a> </div>
<div id="masthead">
<h1 id="siteName">Telforce Communications SL - cPanel </h1>
<!-- end globalNav -->
<div id="subglobal1" class="subglobalNav">
<a href="#">subglobal1 link</a> | <a href="#">subglobal1 link</a> | <a href="#">subglobal1
link</a> | <a href="#">subglobal1 link</a> | <a href="#">subglobal1 link</a> | <a href="#">subglobal1
link</a> | <a href="#">subglobal1 link</a>
</div>
<div id="subglobal2" class="subglobalNav">
<a href="#">subglobal2 link</a> | <a href="#">subglobal2 link</a> | <a href="#">subglobal2
link</a> | <a href="#">subglobal2 link</a> | <a href="#">subglobal2 link</a> | <a href="#">subglobal2
link</a> | <a href="#">subglobal2 link</a>
</div>
<div id="subglobal3" class="subglobalNav">
<a href="#">subglobal3 link</a> | <a href="#">subglobal3 link</a> | <a href="#">subglobal3
link</a> | <a href="#">subglobal3 link</a> | <a href="#">subglobal3 link</a> | <a href="#">subglobal3
link</a> | <a href="#">subglobal3 link</a>
</div>
<div id="subglobal4" class="subglobalNav">
<a href="#">subglobal4 link</a> | <a href="#">subglobal4 link</a> | <a href="#">subglobal4
link</a> | <a href="#">subglobal4 link</a> | <a href="#">subglobal4 link</a> | <a href="#">subglobal4
link</a> | <a href="#">subglobal4 link</a>
</div>
<div id="subglobal5" class="subglobalNav">
<a href="#">subglobal5 link</a> | <a href="#">subglobal5 link</a> | <a href="#">subglobal5
link</a> | <a href="#">subglobal5 link</a> | <a href="#">subglobal5 link</a> | <a href="#">subglobal5
link</a> | <a href="#">subglobal5 link</a>
</div>
<div id="subglobal6" class="subglobalNav">
<a href="#">subglobal6 link</a> | <a href="#">subglobal6 link</a> | <a href="#">subglobal6
link</a> | <a href="#">subglobal6 link</a> | <a href="#">subglobal6 link</a> | <a href="#">subglobal6
link</a> | <a href="#">subglobal6 link</a>
</div>
<div id="subglobal7" class="subglobalNav">
<a href="#">subglobal7 link</a> | <a href="#">subglobal7 link</a> | <a href="#">subglobal7
link</a> | <a href="#">subglobal7 link</a> | <a href="#">subglobal7 link</a> | <a href="#">subglobal7
link</a> | <a href="#">subglobal7 link</a>
</div>
<div id="subglobal8" class="subglobalNav">
<a href="#">subglobal8 link</a> | <a href="#">subglobal8 link</a> | <a href="#">subglobal8
link</a> | <a href="#">subglobal8 link</a> | <a href="#">subglobal8 link</a> | <a href="#">subglobal8
link</a> | <a href="#">subglobal8 link</a>
</div>
</div>
<!-- end masthead -->
<div id="pagecell1">
<!--pagecell1-->
<img alt="" src="tl_curve_white.gif" height="6" width="6" id="tl"> <img alt="" src="tr_curve_white.gif" height="6" width="6" id="tr">
<div id="breadCrumb">
</div>
<div id="pageName">
<h2>Welcome</h2>
</div>
<div id="pageNav">
<div id="sectionLinks"><a href="invoices.php">Invoices</a><a href="/cviewtel/payments.php">Payments</a><a href="/cviewtel/personal.php">Personal Information</a><a href="http://www.telforce.co.uk">Telforce Homepage</a></div>
</div>
<div id="content">
<div class="story">
<p>Call Usage (current month) </p>
<p class="style3">*Note > Any discounts & credits will be calculated at the end of month (if applicable).</p>
<p> <?php $username = $POST['username'];
$password = $POST['password'];
$self = $SERVER['PHP_SELF'];
$referer = $SERVER['HTTP_REFERER'];
if( ( !$username ) or ( !$password ) )
{ header( "Location:$referer" ); exit(); }
$conn = @mysql_connect( "localhost", "rcox", "joshua" )
or die ( "Could not connect" );
$rs = @mysql_select_db( "rates", $conn )
or die( "Could not select database" );
$sql="select * from users where username=\"$username\"
and password = password( \"$password\" )";
$rs = mysql_query( $sql, $conn )
or die( "Could not execute query" );
$num = mysql_numrows( $rs );
if( $num != 0 ){
$rs = @mysql_select_db( "rates", $conn )
or die( "Could not select database" );
$sql = "select * from cdr where username='$username'";
$rs = mysql_query( $sql, $conn )
or die( "Could not execute query" );
$list = "<table border=\"0\" cellpadding=\"5\">";
$list .= "<tr><th>date</th>";
$list .= "<th>time</th>";
$list .= "<th>number</th>";
$list .= "<th>destination</th>";
$list .= "<th>duration</th>";
$list .= "<th>cost</th></tr>";
while( $row = mysql_fetch_array( $rs ) )
{
$list .= "<tr>";
$list .= "<td>".$row["date"]."</td>";
$list .= "<td>".$row["time"]."</td>";
$list .= "<td>".$row["number"]."</td>";
$list .= "<td>".$row["destination"]."</td>";
$list .= "<td>".$row["duration"]."</td>";
$list .= "<td>".$row["cost"]."</td>";
$list .= "</tr>";
}
$list .= "</table>";
echo( $list );
}
else{
header("Location: login.php");
}
?> </p>
</div>
</div>
</div>
<!--end pagecell1-->
<br>
<script type="text/javascript">
<!--
var menuitem1 = new menu(7,1,"hidden");
var menuitem2 = new menu(7,2,"hidden");
var menuitem3 = new menu(7,3,"hidden");
var menuitem4 = new menu(7,4,"hidden");
var menuitem5 = new menu(7,5,"hidden");
var menuitem6 = new menu(7,6,"hidden");
var menuitem7 = new menu(7,7,"hidden");
// -->
</script>
</body>
</html>