Re: Rewrite Module Session problem



Cristisor wrote:
Hi. I have this problem and I don't know how to solve it. This code
that you see bellow is included in 3 web pages and I go through all 3
one after the other. In every situation the status is 0. The first 2
times $_SESSION['POST'] is not set, but the 3rd time it is set and it
is empty, and I can't figure why. The first 2 times I do exactly the
same thing and nowhere else in the code I use $_SESSION['POST']. If
Rewrite Module is not activated things are ok, I don't have the
problem. But when it is activated, this thing happens.
if (isset($_SESSION['POST'])) {
$_POST = $_SESSION['POST'];
unset($_SESSION['POST']);
}
...
if ($status) {
$_SESSION['POST'] = $_POST;
header("Location: ... ");
die;
}

If I use "if (!empty($_SESSION['POST'])) { }" instead of "if
(isset($_SESSION['POST'])) {}" I have no problem with Rewrite Module
activated.
Maybe someone has any ideea. Thank you very much!


Not really enough information to tell. But one thing I notice - you should NOT be trying to change the $_POST array itself. Even changing a parameter in the array is not good - replacing the entire array like you are destroys it's superglobal status.

Rather, create a local array and set it to either $_POST or $_SESSION['POST'].

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@xxxxxxxxxxxxx
==================

.



Relevant Pages

  • Re: PHP File Upload Fails
    ... Problem Solved - Duplicate form tag causing the File Array to not work. ... Even with uploads disabled in php.ini, the POST array ... upload contains the name of the file *** ... // set up basic connection ...
    (comp.lang.php)
  • Re: [PHP] Comparing string to array
    ... // How to check if $userparam exists in the $_POST array ... echo 'yeah'; ... "Some men are born to greatness, some achieve greatness, ...
    (php.general)
  • Re: PHP File Upload Fails
    ... The FILES array should contain the file ... Even with uploads disabled in php.ini, the POST array ... Whether to allow HTTP file uploads ...
    (comp.lang.php)
  • Re: [PHP] How to get the key of a specific index of array?
    ... > reason .. ... > Which will give you the first three elements of the array, ... > with a $_POST array you can do foreach with. ... But if these required three keys are messed up into the $_POST array, ...
    (php.general)
  • Re: need help with $_POST variables
    ... Warning: Wrong parameter count for curl_setoptin D:\ULEM ... It also happens that many elements of my $_POST array ... you can't use arrays - but then you can't send a PHP array in a ... You'll have to parse your $_POST array out into id/value ...
    (comp.lang.php)