Hi all, can anyone explain to me why this function:
function sql_lang($lang) {
//this function gets the value of lang, allowing SQL Queries to access the right tables
if ($lang == "eng") {
//access the english review table
$rev = "reviewsGB";
return $rev;
} elseif ($lang == "ger") {
//access the german review table
$rev = "reviewsD";
return $rev;
} else {
//redirect user to language select page, because they have accessed this page without specifying a language
header("Location: [url]http://www.metal-observer.com/[/url]");
exit;
}
}
in the file "default.php", refuses to return $rev to part of another script:
include ("../default.php");
sql_lang($lang);
$query = "SELECT * FROM $rev";
...etc
? I can't understand it...
I've tried doing a
print $rev;
But that didn't print anything, so I know its a problem with the return. Also, if I access the page when lang does not equal "ger" or "eng" the header does indeed redirect me, so its not a problem with the $lang variable...
can anyone help please?
Cheers,