1

Parse error: syntax error, unexpected end of file in C:\wamp\www\php\webform.php on line 41. I have been trying to fix this but its keeps retuning this error. I don't know why its showing this

<html>
<head>
    <title></title>
</head>
<body>

<?php
$DisplayForm = TRUE;
$Number ="";

if(isset($_POST['Submit'])){
$Number = $_POST['Number'];
if (is_numeric($Number))
    $DisplayForm = FALSE;
else
{
    echo "<p>You need to enter a numeric value.</p>\n";
        $DisplayForm = TRUE;
}
}

if ($DisplayForm)
    {?>
    <form name="NumberForm" action="webform.php" method="post">
    <p>Enter a number : <input type="text" name="Number" value="<?php echo    $Number; ?>"/></p>
    <p><input type="reset" value="Clear Form"/>&nbsp;
    <input type="submit" name="Submit" value="Send Form"/></p>  
    </form>

    <?php}
    else {
            echo "<p>Thank you for entering a number</p>";
            echo "<p>Your number, $Number, squared is ". ($Number*$Number).".</p>\n ";
            echo "<p><a href=\"webform.php\">Try again?</a></p>\n";
        }
?>
</body>
</html>
0

1 Answer 1

2

Just give space between <?php}

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.