Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
I'm running in to an issue with SESSIONS on IE 7. I tested out correctly on Opera 9.10 and Firefox 2.0.
I am running a form with username submission on PAGE 1. Using a form processor file which changes over from POST to SESSION then redirectoring to a SESSION value print page - PAGE 2. On PAGE 2 in IE a new SESSION is created and the values from old one do not transfer over.
I don't know what I can do to make it work properly in IE. PLEASE help.
PAGE1.phpCode: Select all
<?PHP
header ("Expires: Wed, 31 May 2004 10:17:17 GMT"); // Date in the past
header ("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); // always modified
header ("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
header ("Pragma: no-cache"); // HTTP/1.0
?>
<form action="formprocessor.php" method="post" enctype="multipart/form-data" name="form1">
<label>User Name :
<input name="username" type="text" id="username" size="20" maxlength="20">
</label>
<p>
<label>
<input type="submit" name="submit" value="submit">
</label>
</p>
</form>
FORMPROCESSOR.PHP
<?PHP
if(!isset($_SESSION))
{
session_start();
}
if(isset($_POST['submit'])
{
foreach($_POST as $key => $value)
{
$_SESSION[$key]=$value;
}
header("Location: http://localhost/page2.php");
}
?>
PAGE2.php
<?PHP
header ("Expires: Wed, 31 May 2004 10:17:17 GMT"); // Date in the past
header ("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); // always modified
header ("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
header ("Pragma: no-cache"); // HTTP/1.0
if(!isset($_SESSION))
{
session_start();
}
foreach($_SESSION as $key => $value)
{
echo "<BR>Here is session : ".$key ." => ".$value;
}
?>feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]