PDA

View Full Version : How do you include a variable?


kau
12-10-2007, 04:29 PM
I have this statement;

ob_start();
include('../footer.php');
$externalwebfooter = ob_get_contents();
ob_end_clean();

That works but I need to pass it a variable like this;

ob_start();
include('../footer.php?FUNCTION=TODAYVOTES');
$externalwebfooter = ob_get_contents();
ob_end_clean();

This however will not work. No errors, it just doesn't like the ?FUNCTION=TODAYVOTES.

Is there a workaround for this?

Marco van Herwaarden
12-11-2007, 05:32 AM
AFAIK you can not pass variables with include(). Depending on how the target script is coded, you might be able to set the "function" variable before including the script.