[eluser]got 2 doodle[/eluser]
I can't even pretend to understand how codeextinguisher "works" but if it's any kind of clue I recently changed from apache 2.2 to xampp and I had to make the following changes to my code so that my index.php (not using codeigniter, just plain php that I cobbled together)
Code:
?php
session_start();
include('util.php'); // misc generic utils
/* edit on change to xampp was required to $_GET[ ''] passed vars */
$id=$_GET['id']; /* <----- line added */
if (empty($id)) {$id='0';}
$lang=$_GET['lang']; /* <----- line added */
if (empty($lang)) { $lang='en'; }
This is the contents of util.php
Code:
<?php /* util.php */
/* Function to format varibles and not overwrite PHP session variables
sample call:
<a href="session_var.php<?php echo UrlVars("id","1"); ?>">Set id = 1</a>
example result:
session_var.php?lang=eng&id=1&PHPSESSID=afac9a4cf3ba13a3f3c845dfc73279a7
Call this way --> UrlVar("variable name","variable value");
*/
function UrlVar() {
$arg = array();
$string = "?";
$vars = $_GET;
for ($i = 0; $i < func_num_args(); $i++)
$arg[func_get_arg($i)] = func_get_arg(++$i);
foreach (array_keys($arg) as $key)
$vars[$key] = $arg[$key];
foreach (array_keys($vars) as $key)
if ($vars[$key] != "") $string.= $key . "=" . $vars[$key] . "&";
if (SID != "" && SID != "SID" && $_GET["PHPSESSID"] == "")
$string.= htmlspecialchars(SID) . "&";
return htmlspecialchars(substr($string, 0, -1));
}
function VisitorIP()
{
if(isset($_SERVER['HTTP_X_FORWARDED_FOR']))
$TheIp=$_SERVER['HTTP_X_FORWARDED_FOR'];
else $TheIp=$_SERVER['REMOTE_ADDR'];
return trim($TheIp);
}
?>
(looks horrible I know)
Anyway before xampp the code worked without the
running windows XP and xampp 1.6.6a php5.2.5
Jeff