<table border="0" cellpadding="0" cellspacing="0" width="800" class="none" id="table1">
<tr>
<td width="11%"><font size="1" color="#666666">
<form name="style" method="post">
<br>
<select name="style" class="field" size="1" onChange="document.style.submit();">
<option selected>-----</option>
<option value="default">Fire Grey</option>
</select>
<noscript>
<input type="submit" class="field" />
</noscript>
style</form>
<form>
<br>
<select name="lang" class="field" size="1" onChange="document.lang.submit();">
<option selected>-----</option>
<option value="english">en</option>
<option value="arabic">ar</option>
</select>
<noscript>
<input type="submit" class="field" />
</noscript>
lang</form>
</font></td>
</tr>
</table>
<p>the code <?php echo $lang['lang'] ?> is in the next line,, if its set to
english then it should echo "lang is english" and in arabic it should echo
"lang is arabic"</p>
start of code -------( <?php echo $lang['lang'] ?> )------- end of code
</body>
</html>
and lang/english.php
PHP Code:
<?php
$lang['lang'] = 'lang is english';
?>
and in arabic.php
PHP Code:
<?php
$lang['lang'] = 'lang is arabic';
?>
by the way i kept the style selector just to conform that it still works,,,
You close the PHP tags, insert a newline and then open the PHP tags again. Unfortunately that newline gets sent to the browser which means no more headers can be sent so as soon as you try and write the following cookie (which has to be sent with the header data) it generates the header already sent error. If you are sending headers from PHP, including writing sessions or cookies, then it cannot be stressed enough that you can't output anything to the browser at all before you do so, not even a single little whitespace. Just get rid of the ?> <? at the start of that section of code and hopefully the error should go away.
Incidentally, in this code snippet you are setting a cookie called css but then trying to access a cookie called lan, I assume you meant to have setcookie('lan',$style_sheet... etc.
<table border="0" cellpadding="0" cellspacing="0" width="800" class="none" id="table1">
<tr>
<td width="11%"><font size="1" color="#666666">
<form name="style" method="post">
<br>
<select name="style" class="field" size="1" onChange="document.style.submit();">
<option selected>-----</option>
<option value="default">Fire Grey</option>
</select>
<noscript>
<input type="submit" class="field" />
</noscript>
style</form>
<form>
<br>
<select name="lang" class="field" size="1" onChange="document.lang.submit();">
<option selected>-----</option>
<option value="english">en</option>
<option value="arabic">ar</option>
</select>
<noscript>
<input type="submit" class="field" />
</noscript>
lang</form>
</font></td>
</tr>
</table>
<p>the code <?php echo $lang['lang'] ?> is in the next line,, if its set to
english then it should echo "lang is english" and in arabic it should echo
"lang is arabic"</p>
start of code -------( <?php echo $lang['lang'] ?> )------- end of code
</body>
</html>
and the lang files are still the same,,
i mean when i enter it says
Code:
the code <?php echo $lang['lang'] ?> is in the next line,, if its set to english then it should echo "lang is english" and in arabic it should echo "lang is arabic"
start of code -------( lang is english )------- end of code
but when i change the lang drop down nothing happens..
What happens here is that the language gets stored in the "css" cookie. Then the css file gets written over the top of it (since cookies get written in reverse order for some reason).
but still,, there is something in the SECOND form that is wrong... it does not change the lang,, maybe its something in the FORM that is not responding..
<table border="0" cellpadding="0" cellspacing="0" width="800" class="none" id="table1">
<tr>
<td width="11%"><font size="1" color="#666666">
<form name="style" method="post">
<br>
<select name="style" class="field" size="1" onChange="document.style.submit();">
<option selected>-----</option>
<option value="default">Fire Grey</option>
</select>
<noscript>
<input type="submit" class="field" />
</noscript>
</form>
<form>
<select name="lan" class="field" size="1" onChange="document.lan.submit();">
<option selected>-----</option>
<option value="default">en</option>
<option value="arabic">ar</option>
</select>
<noscript>
<input type="submit" class="field" />
</noscript>
</form>
</font></td>
</tr>
</table>
<p>the code <?php echo $lang['lang'] ?> is in the next line,, if its set to
english then it should echo "lang is english" and in arabic it should echo
"lang is arabic"</p>
start of code -------( <?php echo $lang['lang'] ?> )------- end of code
</body>
</html>
and the lang/default.php is this
PHP Code:
<?php
$lang['lang'] = 'english';
?>
and if you noticed in the site it just says the first letter,,