Hi,
this is probably something very simple, but I have tried for quite a while to fix it and have come up short. I have the following nested if… else segment, but for some reason PHP complains about the last else.
<?php
if ( $user = $kirby->user() ){
if ($user->name() != ""){ ?>
<div class="greeting">Hello <?= $user->name() ?>! <form action="<?= $page->url() ?>" method="POST"><input type="submit" name="logout" value="Logout"></form></div>
<?php } else { ?>
<div class="greeting">You are logged in! <form action="<?= $page->url() ?>" method="POST"><input type="submit" name="logout" value="Logout"></form></div></div>
}?>
<?php if($success) { ?>
<div class="alert success">
<p><?= $success ?></p>
<p><?= $output ?></p>
</div>
<?php } elseif (isset($alert['error'])) { ?>
<div><?= $alert['error'] ?></div>
<?php } ?>
<form action="<?= $page->url() ?>" method="POST">
<label for="url">URL:</label>
<input type="text" id="url" name="url" value="<?= esc($data['url'] ?? '', 'attr') ?>" required>
<input type="submit" name="submit" value="Submit">
</form>
<?php } else { ?>
<div class="greeting"><form action="<?=$page->url()?>" method="POST"><input type="submit" name="login" value="Login"></form>'
<?php }; ?>
Can someone please help me see the error of my ways?