Code: Select all
in .htaccess
RewriteRule ^test_file/(.*).php /subfolder/test_file.php?arg1=blah&arg2=$1
test_file.php
<?php
session_start();
//this is the problematic line...
echo '<img src="nonexistentpath/php_button.gif" alt="Get php"><br>';
echo "variable $ _SESSION['xxxx'] = ".$_SESSION['xxxx'].'<br>';
if (!isset($_SESSION['xxxx'])){
$_SESSION['xxxx'] = 0;
}
$_SESSION['xxxx']++;
?>Now comes the weird beaviour:
If I call it without using the mod_rewrite, i.e
http://myip/subfolder/test_file.php
I get the expected results for the session var, which starts with 1 and after every page load adds its value 1 by 1
but, if I call it like this
http://myip/subfolder/test_file/whatever.php
$_SESSION['xxxx'] starts with 2, and then its values are 4, 6, 8 ....
Can anyone reproduce this kind of craziness, or is it just a problem with my server (local) ?