Jump to content

Problem passing long sessions from one form to another in IExplorer


aldrin151

Recommended Posts

Hello everyone, I came across an interesting issue. I'm passing long session variables from one form to another. The only browser that I'm having the issue with is IExplorer and its version 7 I'm using. I get a "Internet Explorer cannot display the webpage". With firefox it seems to work fine. For example, I have below an example...Can someone tell me the reason this is happening?  ??? Thanks...

 

Form 1

<?

session_start();

$_SESSION['description_d'] = "Some Long text";

 

?>

 

Form 2

<?

session_start();

$flddescription = $_SESSION['description_d'];

 

?>

Thanks for the reply DarkWater,

 

Well if you go to http://www.dbluestudio.com/1.php, you can view a demonstration of the issue I 'm having...I have made two php pages...when you enter a long text like 2500 characters in 1.php form and submit the form it goes to the Internet Explorer error page...on Mozilla you don't get that problem...

 

1.php

 

<?

echo "<form action=2.php method=get><textarea name=test cols=100 rows=40></textarea><input type=submit value=Post /></form>";

?>

 

2.php

 

<?

session_start();

$_SESSION['test'] = $_GET["test"];

echo $_SESSION['test'];

?>

 

This has nothing to do with sessions. Your form is using the GET method and each browser/server has a limit on how long of a URL it will operate on - http://www.boutell.com/newfaq/misc/urllength.html

Basically I would like to have a client enter the information in the first form without it being entered into the database, then preview it on the second form and if everything looks ok then can be entered in the database.

Do it this way, instead (using POST)

<?php
if(isset($_POST['action'])){
	//insert into the database
} else if(isset($_POST['preview'])){
	//show the information the client submitted
} else {
	// echo the textbox
	echo '<input type="submit" name="preview" value="Preview">';
	echo '<input type="submit" name="action" value="Post">';
}
?>

 

Or if you want to require that the client previews the information first, simply move the submit button named "action" into the $_POST['preview'] else-if statement.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.