I have a page that is submitting data to itself, and the code I have is working, but the problem is when I load my page this error Notice: Undefined index: submitted
in is on the page when I get there. However, once I give it the data and click submit, the error goes away and everything else goes smoothly. Any idea how to get rid of this?
<form method="POST" action="contactInfo.php">
<center>
Name: <input type="text" name="name"/>
Email: <input type="text" name="email"/>
<input type ="submit" name="submitted" value="Submit" /> <br />
<?php
$formSubmitted = $_POST['submitted'];
if ($formSubmitted)
{
echo "Thank you for your information.";
} ?>