Jump to content

Conection reset when posting


SharkBait

Recommended Posts

Oh I guess I can, but the bit of post that I want posted, is resetting my connection...

Ok on one of my scripts I set the session at the top of the script and then I use javascript to display it at the very bottom of the script, but the bottom alert I use to display the session variable seems to be null where at the top it is not.

At the top:

[code]
<?php
if(isset($_POST['type'])) {
$_SESSION['myLastSearch'] = $_POST['type'];
echo "<script type=\"text/javascript\">alert('TYPE: {$_SESSION['myLastSearch']}');</script>";
}

require("includes/header.html");

?>
[/code]


At the bottom of the script

[code]
<?php
echo "<script type=\"text/javascript\">alert('TYPE: {$_SESSION['myLastSearch']}');</script>";

require("includes/footer.html");
?>
[/code]

There are no lines that set $_SESSION['myLastSearch'] anywhere else in the script so I don't know why the bottom is not displaying what the top is.

I'm at a loss :)
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.