I have a form as follows:
Code: Select all
<form method="POST" action="../index.php">
<tr><td>Account No.:</td><td><input type="text" size="15" name="username"></td></tr>
<tr><td>Password:</td><td><input type="text" size="15" name="password"></td></tr>
<input class=button type="submit" value="Submit" name="submit">
</form>Code: Select all
<?
session_start();
session_register ("username");
session_register ("password");
if(!$HTTP_SESSION_VARS["username"]){
$HTTP_SESSION_VARS["username"]=$HTTP_POST_VARS['username'];
}
if(!$HTTP_SESSION_VARS["password"]){
$HTTP_SESSION_VARS["password"]=$HTTP_POST_VARS['password'];
}
?>Now my index.php script calls an i-frame as follows:
Code: Select all
<iframe name=main src="main.php" width="581" height="354" scrolling=auto></iframe>However if I now try to access the session variables in the i-frame script main.php as follows....
Code: Select all
echo $HTTP_SESSION_VARS["username"];What am I doing wrong, are session variable not global in scope?
Thanks in advance.
Rob.