PDA

View Full Version : php login passover to frameset target


scorch386
07-24-2009, 07:05 AM
I am trying to figuar out how to target in php login information to a different frameset. I have a Server behavior set up to login to my site though mysql. It can login but it show in the top frame and i cant get it to on succesful login redirect the bottom frame in the frameset....

i have this code in my frameset page

</head>
<frameset rows="155,*" cols="*" framespacing="1" border="1">
<frame src="topbaselogon.php" name="top" scrolling="no" noresize marginwidth="10" marginheight="10" id="top">
<frame src="baselogonbottom.html" name="bottom" scrolling="auto" noresize marginwidth="10" marginheight="10" id="bottom">
</frameset>
<noframes><body>
</body></noframes>


my top frame (topbaselogon.php) i have my login form and this code..

<?php require_once('Connections/LoginFiles.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
if (PHP_VERSION < 6) {
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
}
$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}
?>
<?php
// *** Validate request to login to this site.
if (!isset($_SESSION)) {
session_start();
}
$loginFormAction = $_SERVER['PHP_SELF'];
if (isset($_GET['accesscheck'])) {
$_SESSION['PrevUrl'] = $_GET['accesscheck'];
}
if (isset($_POST['user'])) {
$loginUsername=$_POST['user'];
$password=$_POST['pass'];
$MM_fldUserAuthorization = "";
$MM_redirectLoginSuccess = "logintruevalue.php";
$MM_redirectLoginFailed = "loginfalsevalue.html";
$MM_redirecttoReferrer = false;
mysql_select_db($database_LoginFiles, $LoginFiles);

$LoginRS__query=sprintf("SELECT uname, pword FROM `user` WHERE uname=%s AND pword=%s",
GetSQLValueString($loginUsername, "text"), GetSQLValueString($password, "text"));

$LoginRS = mysql_query($LoginRS__query, $LoginFiles) or die(mysql_error());
$loginFoundUser = mysql_num_rows($LoginRS);
if ($loginFoundUser) {
$loginStrGroup = "";

//declare two session variables and assign them
$_SESSION['MM_Username'] = $loginUsername;
$_SESSION['MM_UserGroup'] = $loginStrGroup;
if (isset($_SESSION['PrevUrl']) && false) {
$MM_redirectLoginSuccess = $_SESSION['PrevUrl'];
}
header("Location: " . $MM_redirectLoginSuccess );
}
else {
header("Location: ". $MM_redirectLoginFailed );
}
}
?>

I want to figuar out a way to target my lower frame (baselogonbottom.html) though the php code. I dont know what to change or add to target the lower frame from the upper frames php???:x :x :x

edbr
07-24-2009, 07:53 AM
frames ? no idea but it might be possible. either hardcode the variable or the location itself maybe

header("Location: " . $MM_redirectLoginSuccess );

scorch386
07-24-2009, 05:28 PM
How can i do this?? I am really new to php and i really dont know what to do to hardcode?? this code was created though the server behaviors in dreamweaver..... please help
either hardcode the variable or the location itself maybe

header("Location: " . $MM_redirectLoginSuccess )

edbr
07-25-2009, 03:16 AM
hardcoded it could be some thing like
header("Location: " mypage.php" )
frames, personally i wouldn't touch