Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9014197
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T03:27:06+00:00 2026-06-16T03:27:06+00:00

how can i correct this error i am getting when i try to load

  • 0

how can i correct this error i am getting when i try to load my page,

Parse error: syntax error, unexpected $end in C:\xampp\htdocs\mysite\index.php on line 46

the code on line 46 is this one below

?>

and my code is this one

<?php session_start();?>

<!DOCTYPE html>
<html lang="en">
<?php
if (isset ($_post['submit'])){
    $error_count = 0;
    $error_message = array();
//trim removes the spaces
  $validate = trim(strtolower($_post['validate']));
  if($validate != get_answer() ){ 
  $error_count++;
  $error_message['validate'] = "validation error";
   }  
 echo $error_count;
if( $error_count > 0){
?>
<form method="post">
<h1> <?php create_function()?></h1>
<label for="validation">Validate:</label>
<input type="text" name="validate" id="validate" />
<?php if(isset($error_message['validate'])):?>
<span style="color: red"><?php echo $error_message['validate']?></span>
<?php endif;?>
<span style="color: green">Reenter Answer to Question</span>
<br/>
<input type="submit" name="submit" value="email">
</form>
<?php
}
else{
?>
<form method="post">
<h1> <?php create_function()?></h1>
<label for="validation">Validate:</label>
<input type="text" name="validate" id="validate" />
<br/>
<input type="submit" name="submit" value="email">
</form>
<?php
}
?>

what exactly am i doing wrong? and how can i fix it?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T03:27:07+00:00Added an answer on June 16, 2026 at 3:27 am

    You are missing one closing parenthesis } I guess it should there before last php closing tag ?>

     <!DOCTYPE html > <html lang = "en" >
      <? php if (isset($_post['submit'])) {
        $error_count = 0;
        $error_message = a rray(); //trim removes the spaces $validate=t rim(strtolower($_post[
        'validate']));
        if ($validate != g et_answer()) {
            $error_count++;
            $error_message['validate'] = "validation error";
        }
        echo $error_count;
        if ($error_count > 0) { ?>
        <form method="post">
    
    <h1> <?php create_function() ?></h1>
    
            <label for="validation">Validate:</label>
            <input type="text" name="validate" id="validate" />
            <?php if (isset($error_message['validate'])) : ?>
    <span style="color: red"><?php echo $error_message['validate'] ?></span>
    
            <?php
        endif; ?>
    <span style="color: green">Reenter Answer to Question</span>
    
                <br/>
                <input type="submit" name="submit" value="email">
        </form>
        <?php } else { ?>
        <form method="post">
    
    <h1> <?php create_function() ?></h1>
    
            <label for="validation">Validate:</label>
            <input type="text" name="validate" id="validate" />
            <br/>
            <input type="submit" name="submit" value="email">
        </form>
        <?php }
    } //guess you are missing this 
    ?>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

When I try to run privoxy, I keep getting this error can't check configuration
I can't get the JOIN syntax correct to alter this existing MySQL query in
How can I correct the following so that I don't receive a syntax error
I'm getting this runtime error R6034 when I try to execute an application in
I am getting this error when I try to preform a segue... 2012-11-14 20:24:54.133
I am getting this error when I try to extract information from an XML
i am getting this error Unexpected error encountered while preparing for the operation. org.eclipse.core.runtime.AssertionFailException
I can't seem to get the correct Unix epoch time out of this PHP
Having this method: public Boolean isCorrect() { return correct; } I can't write: @XmlType(propOrder
This may be super easy to solve but I can't find the correct google

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.