<form action="" method="post">
<div>
<?php if($error['alert'] != ''){
echo "<div class='alert'>" . $error['alert'] . "</div>";
} ?>
<label for="username">Username: *</label>
<input type="text" name="username" value="<?php echo $input['user']; ?>" />
<div class="error"><?php echo $error['user']; ?></div>
<label for="password">Password: *</label>
<input type="password" name="password" value="<?php echo $input['pass']; ?>" />
<div class="error"><?php echo $error['pass']; ?></div>
<p class="required"> * required fields</p>
<input type="submit" name="submit" class="submit" value="submit" />
</div>
</form>
The question here is why use the $error['alert']? this is an array. I don't see where the $error[] comes from. The only place it is defined is in another file and it is defined as nothing
$error['alert'] = '';
so what I am trying to figure out is why do it this way and not this way
$error = '';

Help











