I'm not really sure of this, but since nobody else has replied, I'll add this.
It checks if the user agent (browser) accepts Spanish, and if so, includes indexsp.htm, otherwise includes index.htm. It also sets the content language HTTP header to Spanish or English depending on which file was included.
I've tested it on my computer and the English half works, but I don't know about the Spanish part because I don't have a computer in Spanish.
code:
<?php
if($_SERVER['HTTP_ACCEPT_LANGUAGE']=='es')
{
header('content-language:es');
include 'indexsp.htm';
}
else
{
header('content-language:en');
include 'index.htm';
}
?>
Hopefully somebody with better knowledge can take a look at this and modify or improve this where it needs to be.
Update:
Changed
sp to
es in line two of code.