Well, I am confused now. I read this answer and tried to apply it in my case.
So I made a local PHP file:
<option value="afk" <?php if (isset($_GET['lang'])) {if($_GET['lang'] == 'afk') {echo 'selected';} ?>>Afrikaans (Afrikaans)</option>
<option value="twi" <?php if (isset($_GET['lang'])) {if($_GET['lang'] == 'twi') {echo 'selected';} ?>>Akan (Twi)</option>
<option value="csy" <?php if (isset($_GET['lang'])) {if($_GET['lang'] == 'csy') {echo 'selected';} ?>>Çesky (Czech)</option>
<option value="dan" <?php if (isset($_GET['lang'])) {if($_GET['lang'] == 'dan') {echo 'selected';} ?>>Dansk (Danish)</option>
<option value="deu" <?php if (isset($_GET['lang'])) {if($_GET['lang'] == 'deu') {echo 'selected';} ?>>Deutsch (German)</option>
<option value="eti" <?php if (isset($_GET['lang'])) {if($_GET['lang'] == 'eti') {echo 'selected';} ?>>Eesti (Estonian)</option>
<option value="eng" <?php if (isset($_GET['lang'])) {if($_GET['lang'] == 'eng') {echo 'selected';} ?>>English (English)</option>
<option value="esp" <?php if (isset($_GET['lang'])) {if($_GET['lang'] == 'esp') {echo 'selected';} ?>>Español (Spanish)</option>
<option value="fra" <?php if (isset($_GET['lang'])) {if($_GET['lang'] == 'fra') {echo 'selected';} ?>>Français (French)</option>
<option value="gun" <?php if (isset($_GET['lang'])) {if($_GET['lang'] == 'gun') {echo 'selected';} ?>>Gungbe (Gun)</option>
<option value="hrv" <?php if (isset($_GET['lang'])) {if($_GET['lang'] == 'hrv') {echo 'selected';} ?>>Hrvatski (Croatian)</option>
<option value="ind" <?php if (isset($_GET['lang'])) {if($_GET['lang'] == 'ind') {echo 'selected';} ?>>Indonesia (Indonesian)</option>
<option value="zul" <?php if (isset($_GET['lang'])) {if($_GET['lang'] == 'zul') {echo 'selected';} ?>>IsiZulu (Zulu)</option>
<option value="ita" <?php if (isset($_GET['lang'])) {if($_GET['lang'] == 'ita') {echo 'selected';} ?>>Italiano (Italian)</option>
<option value="lin" <?php if (isset($_GET['lang'])) {if($_GET['lang'] == 'lin') {echo 'selected';} ?>>Lingala (Lingala)</option>
<option value="swk" <?php if (isset($_GET['lang'])) {if($_GET['lang'] == 'swk') {echo 'selected';} ?>>Kiswahili (Swahili)</option>
<option value="htc" <?php if (isset($_GET['lang'])) {if($_GET['lang'] == 'htc') {echo 'selected';} ?>>Kreyòl Ayisyen (Haitian Creole)</option>
<option value="mgy" <?php if (isset($_GET['lang'])) {if($_GET['lang'] == 'mgy') {echo 'selected';} ?>>Malagasy (Malagasy)</option>
<option value="nld" <?php if (isset($_GET['lang'])) {if($_GET['lang'] == 'nld') {echo 'selected';} ?>>Nederlands (Dutch)</option>
<option value="plk" <?php if (isset($_GET['lang'])) {if($_GET['lang'] == 'plk') {echo 'selected';} ?>>Polski (Polish)</option>
<option value="ptb" <?php if (isset($_GET['lang'])) {if($_GET['lang'] == 'ptb') {echo 'selected';} ?>>Português Brasil (Portuguese Brazil)</option>
<option value="rom" <?php if (isset($_GET['lang'])) {if($_GET['lang'] == 'rom') {echo 'selected';} ?>>Română (Romanian)</option>
<option value="sqi" <?php if (isset($_GET['lang'])) {if($_GET['lang'] == 'sqi') {echo 'selected';} ?>>Shqip (Albanian)</option>
<option value="slv" <?php if (isset($_GET['lang'])) {if($_GET['lang'] == 'slv') {echo 'selected';} ?>>Slovenski (Slovenian)</option>
<option value="fin" <?php if (isset($_GET['lang'])) {if($_GET['lang'] == 'fin') {echo 'selected';} ?>>Suomi (Finnish)</option>
<option value="sve" <?php if (isset($_GET['lang'])) {if($_GET['lang'] == 'sve') {echo 'selected';} ?>>Svenska (Swedish)</option>
<option value="fpo" <?php if (isset($_GET['lang'])) {if($_GET['lang'] == 'fpo') {echo 'selected';} ?>>Tagalog (Tagalog)</option>
<option value="trk" <?php if (isset($_GET['lang'])) {if($_GET['lang'] == 'trk') {echo 'selected';} ?>>Türkçe (Turkish)</option>
<option value="vit" <?php if (isset($_GET['lang'])) {if($_GET['lang'] == 'vit') {echo 'selected';} ?>>Việt Nam (Vietnamese)</option>
<option value="eng" <?php if (isset($_GET['lang'])) {if($_GET['lang'] == 'eng') {echo 'selected';} ?>>العربية (Arabic)</option>
<option value="bgr" <?php if (isset($_GET['lang'])) {if($_GET['lang'] == 'bgr') {echo 'selected';} ?>>Български (Bulgarian)</option>
<option value="chs" <?php if (isset($_GET['lang'])) {if($_GET['lang'] == 'chs') {echo 'selected';} ?>>汉语(简化字) (Chinese Simplified)</option>
<option value="ell" <?php if (isset($_GET['lang'])) {if($_GET['lang'] == 'ell') {echo 'selected';} ?>>Ελληνική (Greek)</option>
<option value="hin" <?php if (isset($_GET['lang'])) {if($_GET['lang'] == 'hin') {echo 'selected';} ?>>हिंदी (Hindi)</option>
<option value="rus" <?php if (isset($_GET['lang'])) {if($_GET['lang'] == 'rus') {echo 'selected';} ?>>Русский (Russian)</option>
<option value="tai" <?php if (isset($_GET['lang'])) {if($_GET['lang'] == 'tai') {echo 'selected';} ?>>தமிழ் (Tamil)</option>
<option value="ukr" <?php if (isset($_GET['lang'])) {if($_GET['lang'] == 'ukr') {echo 'selected';} ?>>Українська (Ukrainian)</option>
I then modified my test PHP document. Snippet:
<div style="position: absolute; top: 10px; right: 10px" >
<p>Select Language:</p>
<form method="post">
<select name="SoundRotaLang" onchange="setlang(this.value)">
<?php include('language_combo.php'); ?>
</select></form>
</div>
I uploaded my pages and this a test. That page should end up looking like this really. But it doesn't.
In addition, Expression Web 4 is complaining:
When I actually view my webpage in a browser I can see this at the bottom:
Parse error: syntax error, unexpected end of file in /customers/e/9/c/publictalksoftware.co.uk/httpd.www/msa/language_combo.php on line 38
It stops at the point my PHP code is included.
All I was trying to do was use PHP to build the combo and init the right combo entry via a URL parameter. This way I could replicate this little bit of code in my 37 PHP files and have just one place for the list that gets included.
Confused.