Page 1 of 1

Testing issues with IE 7

Posted: Mon Apr 09, 2007 11:42 am
by peterp69
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]


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.php

Code: 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]

Posted: Mon Apr 09, 2007 12:00 pm
by Ollie Saunders

Code: Select all

if(isset($_POST['submit']
missing parenthesis.?

and please use

Code: Select all

tags in future.

Posted: Mon Apr 09, 2007 1:45 pm
by RobertGonzalez
Stop making the session_start() call as a condition of a set session. Always call it.

Try checking your browser cache settings and your cookie settings as well.

Posted: Tue Apr 10, 2007 3:00 pm
by peterp69
Everah and ole - Thank you very much for info. It helped a lot, its working now.