Login   Register  
PHP Classes
elePHPant
Icontem

File: language.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Stanescu Mihai  >  Language System  >  language.php  >  Download  
File: language.php
Role: Example script
Content type: text/plain
Description: Select language function
Class: Language System
Let the user choose the application idiom
Author: By
Last change:
Date: 3 years ago
Size: 658 bytes
 

Contents

Class file image Download
<?php
if(isset($_GET['lang']) && isset($_GET['href'])){
// Include Language class file
include 'language.class.php';

// Include Config file
include 'config.php';

// Call the language instance
$l = new language(DefaultLang);

$lang strtolower($_GET['lang']);

// Check if the selected language exists
if($l->exists($lang)){
// Save the new language in cookies
setcookie('lang'$lang);

// Get the page before you selected the language
$page $_GET['href'];

// Redirect to the page that you were before select the language
header("Location: $page");
}
else{
die(
'Hacking Attempt');
}

}
else{
die(
'Hacking Attempt');
}
?>