Now I am trying to set up a local mirror of a website. I have whole database and source code of this website. The website runs smoothly in the server, but when I try to visit login.php of the website locally, I got the parse error: syntax error, unexpected '}'. I checked source code of login.php, and there should be no problem with syntax. I also tried different versions of php, but got the same syntax error again and again. Can anybody help me find where the problem is?
The source code of php part in login.php:
<?php
if ($form->Value("email") != "")
?>
<script>document.getElementById('email').value = "<?php echo $form->Value("email"); ?>"</script>
<?
if ($form->Value("pass") != "")
?>
<script>document.getElementById('pass').value = "<?php echo $form->Value("pass"); ?>"</script>
<?
$fields = array("email", "pass");
for ($i=0 ; $i<count($fields) ; $i++) {
if ($form->Error($fields[$i]) != "") {
?>
<script>DisplayMsg(document.getElementById("<?php echo $fields[$i]; ?>"), "<?php echo $form->Error($fields[$i]); ?>", false);</script>
<?php
}//Parse error here: syntax error, unexpected '}'
else {
?>
<script>DisplayMsg(document.getElementById("<?php echo $fields[$i]; ?>"), "", true);</script>
<?php
}
}
?>
I am using XAMPP to set up my local environment. I am new to php, let me know if I need to post more information