This might sound a bit silly.
I have to update a website with a new interface, and although I received the old code I am lost. (As far as I know, I received the complete website, phpPgAdmin included)
Most of the files are .cmt but I’m pretty sure it’s PHP, index.cmt for instance is
<?
include_once('redirected.php');
exit();
function get_lang_from_ip() {
$client_ip = $_SERVER['REMOTE_ADDR'];
$client_hostname = gethostbyaddr($client_ip);
if ($client_ip != $client_hostname) {
$dom_arr = split('\.',$client_hostname);
$lang_id = ($dom_arr[sizeof($dom_arr)-1] == 'hu') ? 'hu' : 'en';
} else {
$lang_id = 'hu';
}
return $lang_id;
}
function set_target() {
$valid_lang_arr = array('hu', 'en');
if (isset($_GET['lang_id']) && in_array($_GET['lang_id'], $valid_lang_arr)) {
$lang_id = $_GET['lang_id'];
} elseif (isset($_COOKIE['lang_id']) && in_array($_COOKIE['lang_id'], $valid_lang_arr)) {
$lang_id = $_COOKIE['lang_id'];
} else {
$lang_id = 'hu'; //get_lang_from_ip();
}
setcookie('lang_id', $lang_id, time()+3600*24*365, '/');
return $lang_id;
}
header('Connection: close');
header('Location: /'.set_target().'/');
?>
The .php files however don’t begin with the <? short opening tag, but with <?php instead. And most importantly, the .cmt files are not parsed, if I navigate to the index.cmt I see the code in the browser, and thus I can’t even put the old layout back together.
Any help is appreciated.
You can make a
.htaccessfile, and include the following:That should allow PHP to be executed on .cmt file extensions.
Please note that this fix can only be used on Apache web servers or others that support
.htaccess.Although, if possible, I’d recommend that you change all
.cmtfile extensions to their appropriate counter part,.php.