<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[PunBB Forums — please help with lang file...]]></title>
		<link>https://punbb.informer.com/forums/topic/15475/please-help-with-lang-file/</link>
		<atom:link href="https://punbb.informer.com/forums/feed/rss/topic/15475/" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in please help with lang file....]]></description>
		<lastBuildDate>Sun, 08 Apr 2007 00:05:01 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: please help with lang file...]]></title>
			<link>https://punbb.informer.com/forums/post/91367/#p91367</link>
			<description><![CDATA[<p>omg i have it works!!!</p><p>thanks a lot</p><p>u r my man &lt;3</p><p>but the last question please..cause i want it can translate to Chinese as well. But the problem is they will have to have different Charset (Encode) ; so what should i do?</p><p>should i add like this ?</p><div class="codebox"><pre><code>if ($lang = cn)
{
$charset = &#039;GB2312&#039;;
}</code></pre></div><p>thank you very much</p>]]></description>
			<author><![CDATA[null@example.com (mystic)]]></author>
			<pubDate>Sun, 08 Apr 2007 00:05:01 +0000</pubDate>
			<guid>https://punbb.informer.com/forums/post/91367/#p91367</guid>
		</item>
		<item>
			<title><![CDATA[Re: please help with lang file...]]></title>
			<link>https://punbb.informer.com/forums/post/91364/#p91364</link>
			<description><![CDATA[<p>Then you need to get the form variable first.&nbsp; Add the following to the beginning of your index.php:</p><p>$lang = $_GET[&#039;lang&#039;];</p>]]></description>
			<author><![CDATA[null@example.com (dmspilot00)]]></author>
			<pubDate>Sat, 07 Apr 2007 23:45:26 +0000</pubDate>
			<guid>https://punbb.informer.com/forums/post/91364/#p91364</guid>
		</item>
		<item>
			<title><![CDATA[Re: please help with lang file...]]></title>
			<link>https://punbb.informer.com/forums/post/91362/#p91362</link>
			<description><![CDATA[<p>but furthermore</p><p>are my codes above right? because i&#039;m not sure it is right or not...</p><p>Thanks</p>]]></description>
			<author><![CDATA[null@example.com (mystic)]]></author>
			<pubDate>Sat, 07 Apr 2007 23:12:33 +0000</pubDate>
			<guid>https://punbb.informer.com/forums/post/91362/#p91362</guid>
		</item>
		<item>
			<title><![CDATA[Re: please help with lang file...]]></title>
			<link>https://punbb.informer.com/forums/post/91361/#p91361</link>
			<description><![CDATA[<p>No I do not turn on register globals.</p><p>Now it only appears the default lang but i can not switch to the other languages...</p><p>I did try your code and it does show </p><div class="codebox"><pre><code>vi,en-us;q=0.9,zh-cn;q=0.8,zh-hk;q=0.6,zh-mo;q=0.5,zh-sg;q=0.4,zh-tw;q=0.3,zh;q=0.1</code></pre></div><p>Please help.</p><p>Thank you very much</p>]]></description>
			<author><![CDATA[null@example.com (mystic)]]></author>
			<pubDate>Sat, 07 Apr 2007 23:10:17 +0000</pubDate>
			<guid>https://punbb.informer.com/forums/post/91361/#p91361</guid>
		</item>
		<item>
			<title><![CDATA[Re: please help with lang file...]]></title>
			<link>https://punbb.informer.com/forums/post/91358/#p91358</link>
			<description><![CDATA[<p>Is $lang set correctly? Is &quot;register globals&quot; enabled on your PHP setup? Try adding the following to the bottom of your page:</p><div class="codebox"><pre><code>&lt;?php echo &quot;The language you selected is $lang&quot;; ?&gt;</code></pre></div><p>FYI It is recommended you NOT use register globals for security reasons.</p>]]></description>
			<author><![CDATA[null@example.com (dmspilot00)]]></author>
			<pubDate>Sat, 07 Apr 2007 21:36:49 +0000</pubDate>
			<guid>https://punbb.informer.com/forums/post/91358/#p91358</guid>
		</item>
		<item>
			<title><![CDATA[please help with lang file...]]></title>
			<link>https://punbb.informer.com/forums/post/91356/#p91356</link>
			<description><![CDATA[<p>Hi all;</p><p>I&#039;m new to php , at the moment i&#039;m trying to make a website which visitor can switch the language on the fly ( no need database) and in the same site(page)..like punbb; the user can choose the language by using lang files.</p><p>Here is my script for <strong>index.php</strong> (main page)</p><div class="codebox"><pre><code>&lt;?php
session_start();

if(!isset($lang)) {
    $lang = getenv(&#039;HTTP_ACCEPT_LANGUAGE&#039;);
    $lang_default = &quot;en&quot;;
}

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

?&gt;    
&lt;body&gt;
&lt;form action=&quot;&lt;?php echo $PHP_SELF;?&gt;&quot; method=&quot;get&quot;&gt;
&lt;select name=&quot;lang&quot; size=&quot;1&quot; onchange=&quot;this.form.submit()&quot;&gt;
 &lt;option value=&quot;en&quot;&gt;English&lt;/option&gt;
&lt;option value=&quot;cn&quot;&gt;France&lt;/option&gt;
        &lt;/select&gt;
&lt;/form&gt;    


&lt;p&gt;&lt;?PHP echo main;?&gt;&lt;/p&gt;


&lt;/body&gt;</code></pre></div><p>and here is my <strong>index.en.php</strong></p><div class="codebox"><pre><code>&lt;?PHP
define(&quot;main&quot;, &quot;How it works?&quot;);</code></pre></div><p>?&gt;</p><p>but the problem is i cant switch it; it always is at the default lang; i cant switch to others. But if i put the form and the script away from the main page. Let the user choose language frist then can access to the main page then it can work.</p><p>Can you guys please help to show how i can get it works inside the web page. So they can always switch the language at the page they are at.</p><p>Please help</p><p>Thank you very much</p>]]></description>
			<author><![CDATA[null@example.com (mystic)]]></author>
			<pubDate>Sat, 07 Apr 2007 16:43:18 +0000</pubDate>
			<guid>https://punbb.informer.com/forums/post/91356/#p91356</guid>
		</item>
	</channel>
</rss>
