I have a frameset, with two frames, I simply need to pass the pass a password and username variable from the main frame, where it has been picked up from a form, to the second of the two frames which is a php memberpage. By the way it needs to be a fresh frameset.
The main frameset is member_frameset.php
<?php
session_start();
//create short variable names
// Here I've collected the posted variables from a previous form
$username = $HTTP_POST_VARS['username'];
$passwd = $HTTP_POST_VARS['passwd'];
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document</title>
</head>
<frameset rows="*" cols="222,*" framespacing="0" frameborder="NO" border="0">
<frame src="main_menu.htm" name="menuleft" scrolling="NO" noresize>
<frame src="member.php" name="menumain">
</frameset>
<noframes><body>
</body></noframes>
</html>
The frame where I need to pass the username and password to is member.php and it is:
<?php
//session_start();
// include function files for this application
require_once('bookmark_fns.php');
//create short variable names
//$username = $HTTP_POST_VARS['username'];
//$passwd = $HTTP_POST_VARS['passwd'];
if ($username && $passwd)
// they have just tried logging in
{
if (login($username, $passwd))
{
// if they are in the database register the user id
$HTTP_SESSION_VARS['valid_user'] = $username;
}
else
{
// unsuccessful login
do_html_header('Problem:');
echo 'You could not be logged in.
You must be logged in to view this page.';
do_html_url('login.php', 'Login');
do_html_footer();
exit;
}
}
do_html_header('Home');
//echo "this is a test in member.php to see how far we've got";
//echo $username;
//echo $passwd;
check_valid_user();
// get the bookmarks this user has saved
if ($url_array = get_user_urls($HTTP_SESSION_VARS['valid_user']));
display_user_urls($url_array);
// give menu of options
display_user_menu();
do_html_footer();
?>
The main frameset definitely gets the username and passwords correctly it's just does not get to the second frame. I've really tried every combination.
I'm a complete novice so please be as descriptive as you can possibly be on the solution.
I think the answer could be in calling the member.php bit and sending the variables attached to this (member.php?$username) well something like that, but again I'm not sure on the syntax and I'm not sure on how to send the two variables or even pick them up in the member.php.
Anyway any help would be gratefully received.
Bill