Menu

[r491]: / trunk / php-java-bridge / examples / php+jsp / hello.php  Maximize  Restore  History

Download this file

47 lines (40 with data), 795 Bytes

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<?php header("Content-type: text/html; charset=UTF-8"); ?>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<title>Hello</title>
<body>
<TABLE border='1'>
<tr>
<th>English</th>
<th><?php
$lang=$_GET['language'];
if(!isset($lang)) $lang="cs_CZ";
echo $lang?>
</th>
</tr>
<tr>
<td>Hello</td>
<td>
<?php
bindtextdomain("hello", "./locale");
textdomain("hello");
setlocale(LC_ALL, $lang);
echo _("hello");
?>
</td>
</tr>
</TABLE>
<form>
<p>
<select name='language'>
<option value="cs_CZ">cs_CZ (Czech)</option>
<option value="de_DE">de_DE (German)</option>
<option value="he_IL">he_IL (Hebrew)</option>
<option value="ja_JP">ja_JP (Japanese)</option>
</select>
<p>
<input type="submit" default="cs_CZ" value="Update"></input>
</form>
</body>
</html>
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.