I keep getting a syntax error on line 104, its probably something very simple I just can't figure it out. Any help would be greatly appreciated.
syntax error, unexpected '{', expecting '('
<?php
$pagetitle = 'Duchy of Gran Fenwick Voting Page';
$thispage = 'regn';
$validinput = true;
$show_form = false;
$id = '';
$fullname = '';
$email = '';
$pass = '';
$choice = '';
if (isset($_POST['submit']))
{
$id = trim($_POST['id']);
$fullname = trim($_POST['fullname']);
$email = trim($_POST['email']);
$pass = trim($_POST['pass']);
$choice = trim($_POST['choice']);
if (empty($fullname))
{
echo '<p>You did not enter your name.
You can not vote unless you submit your name.</p>';
$validinput = false;
}
if (empty($email))
{
echo '<p>You did not enter your email address.
You can not vote unless you submit your email address.</p>';
$validinput = false;
}
if (empty($pass))
{
echo '<p>You did not enter your password.
You can not vote unless you submit your password.</p>';
$validinput = false;
}
if ($choice == NULL)
{
echo '<p>You have not selected a choice for your vote.
Please select an option in order to register your vote.</p>';
$validinput = false;
}
if ($validinput == true)
{
$dbc = mysqli_connect ('host', 'user', 'pass, 'csdipact2010_jmt2');
$check = 'SELECT id FROM voters WHERE email="'
. $email . '"';
$result = @mysqli_query($dbc, $check);
$number = mysqli_num_rows($result);
mysqli_free_result($result);
if ($number > 0)
{
echo 'Sorry - email address ' . $email
. ' is already registered.';
$show_form = true;
}
else
{
$query = 'INSERT INTO voters
(fullname, email, pass, choice)
VALUES ('
. '\'' . $fullname . '\','
. '\'' . $email . '\','
. '\'' . SHA1($pass) . '\', '
. '\'' . $choice . '\');';
$result = @mysqli_query($dbc, $query);
if (!$result)
{
echo '<h1>System Error!</h1>
<p>registration failed</p>';
echo '<p>'. mysqli_error($dbc) . '</p>';
echo 'Query: ' . $query . '</p>';
}
else
{
echo '<p>Thank you, ' . $fullname . '.</p>';
echo '<p>Your email address is ' . $email . ' you have successfully voted</p>';
if ($choice == '1')
{
echo '<p>You voted for the Duke to be President for life.</p>';
}
else if
}
echo '<p>You voted for the Duchess to be President for Life</p>';
}
else
{
echo '<p>You voted for the election of a new President every 5 years.</p>';
}
echo '<p>Congratulations youi have succesgully voted.</p>';
}
}
}
else
{
$show_form = true;
}
}
else
{
$show_form = true;
}
if ($show_form == true)
{
?>
<p>Please tell us about youself, so that we can contact you!</p>
<fieldset>
<form action="jedwardfanclubRegn.php" method = "post">
<p> What is your full name?:
<input type="text" name="fullname" size="20" maxsize="30"
value="<?php echo $fullname; ?>"\>
</p>
<p> What is your email address?:
<input type="text" name="email" size="20" maxsize="30"
value="<?php echo $email; ?>"\>
</p>
<p> Please select a password:
<input type="password" name = "pass" size = "10" maxlength="20"/>
</p>
<p> Please select your voting prefence:
<input type="radio" name="choice" value="1"
<?php if ($prefer == '1') { echo ' checked ';}?> />
The Duke to be President for life.
<input type="radio" name="choice" value="2"
<?php if ($prefer == '2') { echo ' checked ';}?> />
The Duchess to be Presidenty for life.
<input type="radio" name="choice" value="3"
<?php if ($prefer == '3') { echo ' checked ';}?> />
A new President to be elected every 5 years.
</p>
<p>
<input type="submit" name="submit" value="Submit" />
</p>
</form>
</fieldset>
<?php
}
?>