if you want to use both versions, the easiest way would be to create 2 files. for example: english.php and spanish.php - preferrably in an own directory - like "lang" for example.
all parts, words,... you need to have bilingual you have to replace with variables in the main files.
for example the welcome message would be:
<h1>$l_welcome</h1>
and then you define in english.php:
$l_welcome = "Welcome to my webpage";
and in spanish.php:
$l_welcome = "whatever it means in spanish";
finally, you offer the user to switch between spanish/english with a link on your page. for example:
<a href=\"$PHP_SELF?lang=sp\">spanish</a> or <a href=\"$PHP_SELF?lang=en\">english</a>
then, on the top of each page (or even better, include it in an extra file) use something like this:
if ($lang) {
setcookie (languageCookie, "$lang");
header("Location:$PHP_SELF");
}
switch ($languageCookie) {
case "en": include "lang/english.php";
break;
default: include "lang/spanish.php";
break;
}
thats it pretty much - just make sure to use this code at the VERY beginning of your file... the easiest way would be to put it at the top of a header file you call from every page - or like mentioned, write these statements in a file called "chklang.php" or whatever and include it at the very beginning - right after the opening php tag - with
include "chklang.php";
another way without cookies would be to handle the variable "$lang" through all links - but this would be more work and not as clean.
i hope that helps...
sid