I’m getting the following error in this code and am unaware of why the syntax error is being thrown. I’ve looked at the cause of the error and it doesn’t seem to make sense to me. Could any of you php super heroes take a look at this and tell me what I’m doing wrong?
The error is this.
[QUOTE]
Parse error: syntax error, unexpected T_ELSE in /var/www/multilang_feedback.php on line 12
So this is the line it has a problem with.
[QUOTE]
else if(isset($_POST[‘lang’] ) )
Thank you greatly for your time.
[code=php]<?php
//multilang_feedback.php starts 13:39 User Interacton
// demo of User Interaction in PHP
$me = $_SERVER[‘PHP_SELF’];
$choices = array(“en” => “English”, “fr” => “Francais”);
$comment_string = array(“en” => “Comments”, “fr” => “Commentaires”);
$submit_string = array(“en” => “Submit”, “fr” => “Soumettre”);
$return_string = array(“en” => “Return”, “fr” => “Retour”);
else if(isset($_POST[‘lang’] ) )
{
$lang – $_POST[‘lang’];
print(“<form action=”$me” method=”post”>n”);
print(“comment_string[$lang]:”);
print(“<input type=”hidden” name=”lang” value=”$lang”/><br>n”);
print(“<input type=”text” name=”comments” size=”60″/><br>n”);
print(“<input type=”submit” value=”$submit_string[$lang]”/><br>n”);
print(“</form>n”);
}
else
{
print(“<form action=”$me” method=”post”>n”);
print(“<select name=”lang”>n”);
foreach($choices as $c => $n)
{
print(“<option value=”$c”>$n</option>n”);
}
print(“</select>n”);
print(“<input type=”submit” value=”Select Language / Langue Preferee”/><br>n”) print(“</form>n”);
}
?>