PHP Classes

File: example.php

Recommend this page to a friend!
  Classes of Stanescu Mihai   Language System   example.php   Download  
File: example.php
Role: Example script
Content type: text/plain
Description: Just an example of how to use the class
Class: Language System
Let the user choose the application idiom
Author: By
Last change:
Date: 12 years ago
Size: 1,080 bytes


Class file image Download
// Include the class
include 'language.class.php';

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

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

// Check if the language it's saved in cookies else try to load the default language
$loadlang = $language->check();

// Load the language

// Print's constants of the curent language
<title><?php echo Title;?></title>
<!DOCTYPE html
  PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"

<script language="JavaScript">

function loadPage(list) {

  location.href="language.php?href=<?php echo $_SERVER['PHP_SELF'];?>&lang=" + list.options[list.selectedIndex].value


<?php echo Text;?>

<select name="lang" onchange="loadPage(this.form.elements[0])"

<?php echo $language->language_options();?>