when i call include once without any GET parameters it works but with setting GET parameters on trackinglogs.php nothing happens please suggest me what do to..
my php code is: firstfile.php
include_once('trackinglogs.php?todo=setcookie');
?>
my second file is trackinglogs.php
<?php
$action=$_GET['todo'];
switch($action)
{
case "setcookie":
echo "hi";die();
break;
default:
echo "error"; die();
break;
}
?>
thanks for you precious time
You cannot pass parameters when including like that,
includedoes not make an HTTP request.The most minimal solution, although I do not recommend it, is to simply set the parameters yourself so that
trackinglogs.phpfinds them:A much better solution would be to put the code that tracks logs inside a function, and call that providing this operating parameters at the same time. So you ‘d have something like:
And you would do: