Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Aug 2012
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

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

    Parse error: syntax error, unexpected '{' in activate.php on line 5
    Not sure what the issue is here on line 5.

    Code:
    <?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'; ?>

  • #2
    Regular Coder djh101's Avatar
    Join Date
    May 2009
    Location
    California
    Posts
    628
    Thanks
    51
    Thanked 67 Times in 67 Posts
    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.
    "Yeah science!"

  • #3
    New Coder
    Join Date
    Aug 2010
    Location
    myeik
    Posts
    81
    Thanks
    6
    Thanked 5 Times in 5 Posts
    Check it mate
    Code:
    <?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'; ?>


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •