WeberDev.com PHP and MySQL Code

LOG IN
BEGINNER GUIDESPHP CLASSESCODE SEARCHARTICLES SEARCHPHP FORUMSPHP MANUALPHP FUNCTIONS LISTWEB SITE TEMPLATES
Start typing to search for PHP and MySQL Code Snippets and Articles Search
Submit a code Example / Snippet Join us on FaceBook
Submit a code Example / Snippet Submit Your Code
Poker Tournaments Poker Tournaments
Poker Guide for Developers Poker Guide for Developers
Search Engine Optimization Monitor SEO Monitor
Web Site UpTime Monitor UpTime Monitor
Your Personal Examples List My Favorite Examples
Your Personal Articles List My Favorite Articles
Edit Account Info Update Your Profile
PHP Code Search
Web Development Forums
Learn MySQL Playing Trivia
PHPBB2 Templates
Web Development Resources
Web Development Content
Internet Security Software
PHPClasses
PHP Editor
PHP Jobs
Vision.To Design
Ajax Tutorials
PHP Programming Help
PHP/MySQL Programming
Webmaster Resources
Webmaster Forum
XML meta language
website builder
פרייסז - הכח לקנות עובר לידיים שלך
Texas Holdem Poker Evangelists

Go Back Add a Comment Send this example to a friend Add this Article to your personal favoritest for easy future access to your favorite Code Examples and Articles. Submit a code example Print this code example.
BACK ADD A COMMENT SEND TO A FRIEND ADD TO MY FAVORITES ADD CODE EXAMPLES PRINT
Title : multilingual website
Categories : PHP, Languages, Sessions Click here to Update Your Picture
Ben Yacoub Hatem
Date : May 29th 2004
Grade : 3 of 5 (graded 4 times)
Viewed : 22671
File : No file for this code example.
Images : No Images for this code example.
Search : More code by Ben Yacoub Hatem
Action : Grade This Code Example
Tools : My Examples List

Submit your own code examples  Submit your own code examples 
 

If you're looking to code a multilingue website, this is a technique i used in many solutions, specially for text that is inside a php code.

<?php
/**
* index.php
* multilingual website
*  lang/index.fr.php    French translation
*  lang/index.en.php    English translation
*
* @author Hatem <hatem@php.net>
* @version 1.1.0    27 février 2002
*/

/**
* Detect and include language
*/
session_start();

if(!isset(
$lang)) {
   
$lang = getenv('HTTP_ACCEPT_LANGUAGE');
   
$lang_default = "en";
}

if (
is_file("lang/index.$lang.php"))
{
   
$_SESSION["lang"] = $lang;
    include(
"lang/index.$lang.php");
} else {
   
$_SESSION["lang"] = $lang_default;
    include(
"lang/index.$lang_default.php");
}


/**
* Then code your website here
*/
echo _HELLO_;

echo
"\n"._INFO_;
?>



<?php
/**
* lang/index.en.php
*/
define("_HELLO_", "Hello");
define("_INFO_", "This web site support english and french");
?>


<?php
/**
* lang/index.fr.php
*/
define("_HELLO_", "Salut");
define("_INFO_", "Ce site web supporte l'anglais et le français");
?>



GuestBook Light - a plug and play application for any website.
Categories : PHP, Complete Programs, Filesystem, Sessions
How to implement a session tracking system.
Categories : PHP, Sessions, Variables
CSS style switcher
Categories : PHP, CSS, HTML and PHP, Arrays, Sessions
Security, Password lock out after three tries, authorization fails and is logged locked out of account till admin decides he will unlock it.
Categories : Sessions, PHP, MySQL, PHP Options and Info
Warning: Unknown(): A session is active. You cannot change the session module's ini settings at this time. in Unknown on line 0
Categories : PHP, Sessions, Databases, MySQL
Basic Authentication with sessions
Categories : PHP, Beginner Guides, Authentication, Form Processing, Sessions
Simple Session example
Categories : PHP, Beginner Guides, Sessions
Sessions and -enable-trans-sid
Categories : PHP, PHP Configuration, PHP Options and Info, Sessions
Form Security - Match A Value For Success
Categories : PHP, Authentication, HTML and PHP, Sessions, Security
Cross Browser Session Starter
Categories : PHP, Sessions, Cookies
how to check if a string contains a letter from a different language?
Categories : PHP, Regexps, Languages
A beginner's session handling class
Categories : PHP, PHP Classes, Sessions, Beginner Guides
AITSH Statistics
Categories : Complete Programs, Databases, HTML and PHP, Sessions, PHP
Authenticator for Exchange Server LDAP
Categories : PHP, Authentication, LDAP, Security, Sessions
Simple PHP Form Auto Generation based on MySQL query
Categories : PHP, Form Processing, Databases, MySQL, Sessions