i have a page, in iframes and need to change details on login....here was my my code
<?php
session_start();
include 'config.php';
if(isset($_POST['login']))
{
$username = trim(addslashes($_POST['username']));
$password = md5(trim($_POST['password']));
$query = mysql_query("SELECT * FROM Users WHERE Username = '$username' AND Password = '$password' LIMIT 1") or die(mysql_error());
$row = mysql_fetch_array($query);
// now we check if they are activated
if(mysql_num_rows($query) > 0)
{
if($row['Activated'] > 0)
{
$_SESSION['s_logged_n'] = 'true';
$_SESSION['s_username'] = $username;
$_SESSION['s_name'] = $row['Name'];
header("Location: content/member.php");
} else {
echo '
<html>
<head>
<title>Login</title>
<link href="style.css" rel="stylesheet" type="text/css">
</head>
<body>
<div id="error"><p>Sorry, you must activate your account first. Please check your email for the email.</p>
<p>Didn'."'".'t get your validation email? <a href="content/resend.php">Click here</a> to resend the validation email.</p></div>
</body>
</html>
';
}
} else {
echo '
<html>
<head>
<title>Login</title>
<link href="style.css" rel="stylesheet" type="text/css">
</head>
<body>
<div id="error"><p>Login Error. Invalid username/Password. <a href="content/login.php">Try Again</a></p>
<p>Didn'."'".'t get your validation email? <a href="content/resend.php">Click here</a> to resend the validation email.</p>
</div>
</body>
</html>
';
}
} else {
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>tabDB</title>
<link href="../site.css" rel="stylesheet" type="text/css" />
<script language=JavaScript>
var message="";
function clickIE() {if (document.all) {(message);return false;}}
function clickNS(e) {if
(document.layers||(document.getElementById&&!document.all)) {
if (e.which==2||e.which==3) {(message);return false;}}}
if (document.layers)
{document.captureEvents(Event.MOUSEDOWN);document.onmousedown=clickNS;}
else{document.onmouseup=clickNS;document.oncontextmenu=clickIE;}
document.oncontextmenu=new Function("return false")
</script>
<script type="text/JavaScript">
<!--
function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
function MM_swapImgRestore() { //v3.0
var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_swapImage() { //v3.0
var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->
</script>
<style type="text/css">
<!--
body {
background-color: #000000;
}
-->
</style></head>
<body onload="MM_preloadImages('/images/home_over.gif','/images/news_over.gif','/images/media_over.gif','/images/downloads_over.gif','/images/advertise_over.gif','/images/chat_over.gif','/images/forum_over.gif')">
<div align="center">
<p align="left"> </p>
<div align="left"></div>
<table width="801" height="533" border="0" cellpadding="0" cellspacing="0">
<tr>
<td background="images/main.jpg" bgcolor="#000000"><table width="674" border="0" align="left" cellpadding="0" cellspacing="0">
<tr>
<td width="803" height="20" align="center" valign="top"><div align="center">
<form id="form1" name="form1" method="POST" target="main">
<label></label>
<div align="left"><a href="http://www.tab-db.com"><img src="images/banner.gif" border="0" /></a>
<label>
<?php
# If the user is logged in, display their username and logout option
if ( $_SESSION['loggedIn'] )
{
include 'details.php';
}
else
{
echo "<form id='form1' name='form1' method='POST' action='verify.php'>"
."User: <input type=\"text\" size=\"10\" name=\"username\" value=\"\"> "
."Pass: <input type=\"password\" size=\"10\" name=\"password\" value=\"\"/>"
."<input type=\"submit\" name=\"login\" id=\"login\" value=\"Login\" style='width: 50px;'/><br/></form>";
}
?>[/B]
</label>
<input type="text" size="10" name="search" value="search" onfocus="javascript:if(this.value=='search') {this.value='';}" onblur="javascript:if(this.value=='') {this.value='search'}">
<label>
<input type="submit" name="search" id="search" value="Go" />
</label>
<br />
</div>
<label></label>
</form>
<p align="left">
<label></label>
</p>
<p align="center"> <a href="content/index.php" target="main" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('home','','/images/home_over.gif',1)"><img src="images/home.gif" name="home" width="64" height="17" border="0" id="home" /></a> <a href="content/news.php" target="main" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('news','','/images/news_over.gif',1)"><img src="images/news.gif" name="news" width="64" height="17" border="0" id="news" /></a> <a href="content/member.php" target="main" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('media','','/images/media_over.gif',1)"><img src="images/media.gif" name="media" width="64" height="17" border="0" id="media" /></a> <a href="content/downloads.php" target="main" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('downloads','','/images/downloads_over.gif',1)"><img src="images/downloads.gif" name="downloads" width="90" height="17" border="0" id="downloads" /></a> <a href="content/advertise.php" target="main" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('advertise','','/images/advertise_over.gif',1)"><img src="images/advertise.gif" name="advertise" width="74" height="17" border="0" id="advertise" /></a> <a href="content/chat.php" target="main" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('chat','','/images/chat_over.gif',1)"><img src="images/chat.gif" name="chat" width="64" height="17" border="0" id="chat" /></a> <a href="content/forum.php" target="main" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('forum','','/images/forum_over.gif',1)"><img src="images/forum.gif" name="forum" width="64" height="17" border="0" id="forum" /></a> <a href="content/contact.php" target="main" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('contact','','/images/contact_over.gif',0)"><img src="images/contact.gif" name="contact" width="74" height="17" border="0" id="contact" /></a><br />
</p>
</div></td>
</tr>
<tr></tr>
</table>
<p align="left"><br />
<br />
</p>
<p align="left" class="style3"> </p>
<p align="left" class="style3"> </p>
<p><br />
<iframe name="main" allowtransparency="true" height="350" width="690" frameborder="0" scrolling="yes" src="content/index.php" </p>
</td>
</tr>
</table>
</div>
</body>
</html>
<? } mysql_close($l); ?>
with details.php
<?php
'<p>Welcome to the members only page '.$_SESSION['s_name'].'!</p>
<p>You are logged in as '.$_SESSION['s_username'].' from the IP address '.$_SERVER['REMOTE_ADDR'].'</p>',
?>
IT DOESNT WORK??? ANY IDEA??