aldrin151 Posted September 9, 2008 Share Posted September 9, 2008 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']; ?> Link to comment https://forums.phpfreaks.com/topic/123366-problem-passing-long-sessions-from-one-form-to-another-in-iexplorer/ Share on other sites More sharing options...
DarkWater Posted September 9, 2008 Share Posted September 9, 2008 How long exactly would "Some Long text" be? Link to comment https://forums.phpfreaks.com/topic/123366-problem-passing-long-sessions-from-one-form-to-another-in-iexplorer/#findComment-637179 Share on other sites More sharing options...
aldrin151 Posted September 10, 2008 Author Share Posted September 10, 2008 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']; ?> Link to comment https://forums.phpfreaks.com/topic/123366-problem-passing-long-sessions-from-one-form-to-another-in-iexplorer/#findComment-638013 Share on other sites More sharing options...
PFMaBiSmAd Posted September 10, 2008 Share Posted September 10, 2008 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 Link to comment https://forums.phpfreaks.com/topic/123366-problem-passing-long-sessions-from-one-form-to-another-in-iexplorer/#findComment-638014 Share on other sites More sharing options...
aldrin151 Posted September 10, 2008 Author Share Posted September 10, 2008 Is there a solution to this...or other way I can go about this? Link to comment https://forums.phpfreaks.com/topic/123366-problem-passing-long-sessions-from-one-form-to-another-in-iexplorer/#findComment-638016 Share on other sites More sharing options...
Goldeneye Posted September 10, 2008 Share Posted September 10, 2008 What is this form for? Link to comment https://forums.phpfreaks.com/topic/123366-problem-passing-long-sessions-from-one-form-to-another-in-iexplorer/#findComment-638019 Share on other sites More sharing options...
aldrin151 Posted September 10, 2008 Author Share Posted September 10, 2008 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. Link to comment https://forums.phpfreaks.com/topic/123366-problem-passing-long-sessions-from-one-form-to-another-in-iexplorer/#findComment-638022 Share on other sites More sharing options...
Goldeneye Posted September 10, 2008 Share Posted September 10, 2008 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. Link to comment https://forums.phpfreaks.com/topic/123366-problem-passing-long-sessions-from-one-form-to-another-in-iexplorer/#findComment-638025 Share on other sites More sharing options...
aldrin151 Posted September 10, 2008 Author Share Posted September 10, 2008 Thank Goldeneye! But how does this solve my problem of passing long characters thru...I guess some browsers have a limit on how long of characters thru url they pass.? Link to comment https://forums.phpfreaks.com/topic/123366-problem-passing-long-sessions-from-one-form-to-another-in-iexplorer/#findComment-638027 Share on other sites More sharing options...
aldrin151 Posted September 10, 2008 Author Share Posted September 10, 2008 Sorry Goldeneye...I just understood what your trying to say...I guess the more conventional way of passing info would be to use post instead of get....thank you very much! Link to comment https://forums.phpfreaks.com/topic/123366-problem-passing-long-sessions-from-one-form-to-another-in-iexplorer/#findComment-638032 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.