I'm getting an error which states: Notice: Undefined variable: submit on line 4. I have no clue why since I have defined it with the submit button? Can someone please explain why? Don't really see the problem here.
<?php
if($submit)
{
$sql = "INSERT INTO personnel (first, last, username, department, email) VALUES ('$first','$last','$username','$department','$email')";
$add = mysql_query($sql);
echo "<div class='confirmation-box round'>Thank you! New user have been added</div>";
}
else
{
?>
<form method="post" action="useradd.php">
<fieldset>
<p>
<label for="simple-input">Firstname</label>
<input type="text" id="first" name="firstname" class="round default-width-input" />
</p>
<p>
<label for="simple-input">Lastname</label>
<input type="text" id="last" name="lastname" class="round default-width-input" />
</p>
<p>
<label for="simple-input">Username</label>
<input type="text" id="username" name="username" class="round default-width-input" />
</p>
<p>
<label for="simple-input">Department</label>
<input type="text" id="department" name="department" class="round default-width-input" />
</p>
<p>
<label for="simple-input">Email</label>
<input type="text" id="email" name="email" class="round default-width-input" />
</p>
<input type="Submit" name="submit" class="button round blue image-right ic-add text-upper" value="Add">
</fieldset>
</form>
<?php
}
?>
(Sorry for stupid question, kinda new at php)