View Full Version : problem with a function, includes and vars.

09-14-2003, 05:58 PM
The page is cutted in some includes and in one include, there is a function.
In the header, one variable is set:

$var = $_GET['l']

then in the page there is a include:

function location();

the include looks like:

function location() {
if ($var == location1) {
echo ("bla bla bla");
} else if ($var == location2) {
echo ("ble ble ble");

In that include there are several functions and what I want is to use the $var in all the functions, but for that I have to write it in all the functions like this:

function location() {
$var = $_GET['l'];
bla, bla, bla... }

So the question is... How can I pass variables to a function when they are already set??

09-14-2003, 06:04 PM
Forget it, it's done. Delete it if you want. Sorry.