AWESOME! Thanks a lot man. I found it and it took that error away. Now my problem is since I have the form action set to $PHP_SELF it seems to want to do the checking on the variables before i hit the submit button.
MY FULL CODE:
<table width="498" border="0" cellpadding="0" cellspacing="0">
<form name="form" method="post" action="<? $PHP_SELF ?>">
<tr>
<td width="140" height="32" valign="top">
<div align="left">Name: (optional)</div>
</td>
<td valign="top" width="358">
<div align="left">
<input type="text" name="name" size="40">
</div>
</td>
</tr>
<tr>
<td valign="top" height="32">
<div align="left">Email: (optional)</div>
</td>
<td valign="top">
<div align="left">
<input type="text" name="email" size="40">
</div>
</td>
</tr>
<tr>
<td height="28" valign="top">
<div align="left">Request:</div>
</td>
<td valign="top" rowspan="2">
<div align="left">
<textarea name="request" cols="35" rows="5"></textarea>
</div>
</td>
</tr>
<tr>
<td height="118"></td>
</tr>
<tr>
<td height="49" valign="top">
<div align="left">Post Prayer:</div>
</td>
<td valign="top">
<div align="left">
<input type="radio" name="prayer" value="private">
Privately <font size="2">(only viewable by Jon)</font>
<input type="radio" name="prayer" value="public">
public</div>
</td>
</tr>
<tr>
<td height="35"></td>
<td valign="top">
<div align="center">
<input type="submit" name="Submit" value="Submit">
<input type="reset" name="reset" value="Reset">
</div>
</td>
</tr>
</form>
</table>
<?
include("db.php");
$name = $_POST["name"];
$email = $_POST["email"];
$prayer = $_POST["prayer"];
$request = $_POST["request"];
if($name == "")
{
$name = "Anonymous";
}
if((!$prayer) || (!$request)){
echo 'You did not submit the following required information! <br />';
if(!$prayer){
echo "Please select wheather it wil be private or public.<br />";
}
if(!$request){
echo "Please fill out the prayer request box.<br />";
}
}
else
{
$sql = mysql_query("INSERT INTO prayers (name, email, prayer, request, date)
VALUES('$name', '$email', '$prayer', '$request', now())") or die (mysql_error());
}
if(!$sql){
echo 'There has been an error processing the request. <br> Please contact me for information.';
}
else
{
echo "Thank you for your prayer request! God Bless You $name";
}
?>
MY ERRORS:
Notice: Undefined index: name in C:\Accounts\jsniggit\wwwRoot\inc\prayer.php on line 64
Notice: Undefined index: email in C:\Accounts\jsniggit\wwwRoot\inc\prayer.php on line 65
Notice: Undefined index: prayer in C:\Accounts\jsniggit\wwwRoot\inc\prayer.php on line 66
Notice: Undefined index: request in C:\Accounts\jsniggit\wwwRoot\inc\prayer.php on line 67
You did not submit the following required information!
Please select wheather it wil be private or public.
Please fill out the prayer request box.
Notice: Undefined variable: sql in C:\Accounts\jsniggit\wwwRoot\inc\prayer.php on line 88
See what I mean? Sorry for all the crap, It's probably been almost 2 years since ive worked with php. THANKS!!!