...

View Full Version : Parse error: syntax error, unexpected '{' in activate.php on line 5



UploadAce
08-10-2012, 05:48 AM
Parse error: syntax error, unexpected '{' in activate.php on line 5
Not sure what the issue is here on line 5.


<?php
include 'secure/core.php';

if(isset($_POST['submit'])){
if($users->confirmEmail(mysql_real_escape_string($_POST['email']),mysql_real_escape_string($_POST['activation'])){
header( 'Location: login.php?msg=3' ) ;
} else {
header( 'Location: activate.php?msg=1' ) ;
}
}
include 'header.php';
include 'left.php';
?>
<div id="right">

<div class="section">
<?php if($_GET['msg'] == '1') { ?>
<div class="message red"><span><b>Error</b>: The activation code is invalid.</span></div>
<?php } ?>
<div class="box">

<div class="title">

Activate Account

</div>

<div class="content">

<form action="activate.php" method="post">

<div class="row">

<label>Email</label>

<div class="right"><input type="text" value="" name="email" class="{validate:{required:true, messages:{required:'Please enter your email'}}}" /></div>

</div>

<div class="row">

<label>Activate Code</label>
<?php if(isset($_GET['random'])) { ?>
<div class="right"><input type="activation" value="<?php echo $_GET['random']; ?>" name="activation" class="{validate:{required:true, messages:{required:'Please enter the activation code'}}}" /></div>
<?php } else { ?>
<div class="right"><input type="activation" value="" name="activation" class="{validate:{required:true, messages:{required:'Please enter the activation code'}}}" /></div>
<?php } ?>

</div>

<div class="row">

<div class="right">

<button type="submit" name="submit" class="green"><span>Submit</span></button>

</div>

</div>

</form>

</div>

</div>

</div>

</div>

</div>
<?php include 'footer.php'; ?>

djh101
08-10-2012, 08:36 AM
Whenever you get an unexpected error, it usually means you left something unclosed. In this case, you are missing a ) at the end of your if($users->...) statement.

minkoko
08-10-2012, 09:42 AM
Check it mate

<?php
include 'secure/core.php';

if(isset($_POST['submit'])){
if($users->confirmEmail(mysql_real_escape_string($_POST['email']),mysql_real_escape_string($_POST['activation']))){
header( 'Location: login.php?msg=3' ) ;
} else {
header( 'Location: activate.php?msg=1' ) ;
}
}
include 'header.php';
include 'left.php';
?>
<div id="right">

<div class="section">
<?php if($_GET['msg'] == '1') { ?>
<div class="message red"><span><b>Error</b>: The activation code is invalid.</span></div>
<?php } ?>
<div class="box">

<div class="title">

Activate Account

</div>

<div class="content">

<form action="activate.php" method="post">

<div class="row">

<label>Email</label>

<div class="right"><input type="text" value="" name="email" class="{validate:{required:true, messages:{required:'Please enter your email'}}}" /></div>

</div>

<div class="row">

<label>Activate Code</label>
<?php if(isset($_GET['random'])) { ?>
<div class="right"><input type="activation" value="<?php echo $_GET['random']; ?>" name="activation" class="{validate:{required:true, messages:{required:'Please enter the activation code'}}}" /></div>
<?php } else { ?>
<div class="right"><input type="activation" value="" name="activation" class="{validate:{required:true, messages:{required:'Please enter the activation code'}}}" /></div>
<?php } ?>

</div>

<div class="row">

<div class="right">

<button type="submit" name="submit" class="green"><span>Submit</span></button>

</div>

</div>

</form>

</div>

</div>

</div>

</div>

</div>
<?php include 'footer.php'; ?>



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum