Created
March 7, 2010 05:46
-
-
Save segellabs/324175 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
session_start(); | |
if (isset($_GET['bahasa']) and !empty($_GET['bahasa'])) { | |
$_SESSION['bahasa'] = $_GET['bahasa']; | |
} else if (!isset($_SESSION['bahasa'])) { | |
$_SESSION['bahasa'] = 'id'; | |
} | |
$file_bahasa = 'dir_bahasa/'.$_SESSION['bahasa'].'.php'; | |
if (file_exists($file_bahasa)) { | |
include $file_bahasa; | |
} | |
function pilihan_bahasa() | |
{ | |
echo '<ul> | |
<li><a href="?bahasa=id">Indonesia</a></li> | |
<li><a href="?bahasa=en">Inggris</a></li> | |
</ul>'; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
include 'bahasa.php'; | |
?> | |
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"/> | |
<title><?php echo $judul ?></title> | |
</head> | |
<body> | |
<?php pilihan_bahasa()?> | |
<h1><?php echo $judul ?></h1> | |
<div><?php echo $isi ?></div> | |
</body> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$judul = 'This is title'; | |
$isi = 'This is content'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$judul = 'Ini adalah judul'; | |
$isi = 'Ini adalah isi'; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment