The link I suggested contains two different variables. One called page and one called lang. You would need to deal with each differently. Exactly what that means for you, I don't know, as I don't know how you propose to store the different language versions of your site.
You could do something like...
<?php
$page = $_GET['page'];
$lang = $_GET['lang'];
include "./".$lang."/".$page.".php";
?>
so now, if someone requests
index.php?page=resume&lang=fra the system will try to include a file called "./fra/resume.php"
index.php?page=resume&lang=eng the system will try to include a file called "./eng/resume.php"
index.php?page=portfolio&lang=fra the system will try to include a file called "./fra/portfolio.php"
:eek: Watch out. There is one thing you have to be very careful about when doing anything like this. You are giving the visitor power to view any page on your site. A malicious visitor could inject characters like "../" and filenames of their choosing into the request and suddenly your page is including the contents of a passwords file for the world to see.
To get around this, you can use regular expressions to ensure that only alphabetic characters are submitted, or you could even more safely use a switch statement to ensure that your system doesn't do anything unexpected, and doesn't reveal too much about how it works. This is very much like what you originally had.
<?php
switch ($_GET['page']){
//add a case for all expected values
case "resume":
case "portfolio":
case "contact":
$page = $_GET['page'];
break;
//for anything unexpected, use a default
default:
$page = "resume";
}
switch ($_GET['lang']){
//add a case for all expected values
case "eng":
case "fra":
$lang = $_GET['lang'];
//for anything unexpected, use a default
default:
$lang = "fra";
}
include "./".$lang."/".$page.".php";
?>