I am trying to configure something, that if a user correctly inserts the results of integer 'a' and integer 'b', an if clause will execute.

Here is the code:

```
function showPassword()
{
    $a = rand(0, 30);
    $b = rand(0, 10);
    $c = $a + $b;
    echo "<p class='registrationtext'>A=" . $a . "</p>";
    echo "<p class='registrationtext'>B=" . $b . "</p>";
    echo "<p class='registrationtext'>c=" . $c . "</p>";
    $result = mysqli_real_escape_string($link, $_POST['result']);
    $status = "";
    if (isset($_POST['showpassword'])) {
        if ($result != $c) {
            $status = "<p class='websitetext'>Incorrect.</p>";
        } else {
            $status = "<p class='websitetext'>Correct.</p>";
        }
    }
    return $status;
}

```

The problem is, that no matter what I write, I always get the result Incorrect.

**\*\*EDIT\*\***
Here is the form:

```
<?php ob_start() ?>

<p class="websitetext" style="text-decoration:underline;">Show password</p><br/><br/>
<?php echo showPassword() ?>
<form name='usernamechange' action='' method='post' accept-charset='UTF-8'>
    <br/>
<p class="registrationtext">Summed result:</p><br/><input type='text' class="input" name='result' maxlength="50" style="width:50px; height:25px;"/><br/><br/><br/>
</p><br/>

<input type='submit' class="input" name='showpassword' value="Submit" style="width:100px; height:25px;"/>
</form>
<br/><br/>
<?php $content = ob_get_clean() ?>
<?php ob_start() ?>
Password
<?php $title = ob_get_clean() ?>
<?php require 'Templates/Websites/Layout/layout.html.php' ?>

```