bfwdesigns
08-13-2005, 06:44 PM
Hello,
Can someone please help me? I am not familiar with PHP at all and I am trying to use the php mail script. When I click on the "submit" button in the form it gives me an error of
"The following errors were found:
Nothing was sent by a form. (No data was sent by POST or GET method.) There is nothing to process here. "
I dont know what I am doing wrong. Here is my page:
http://www.tindaisy.com/reservations.htm
Please help!!!
Thanks!
Dan L
08-13-2005, 07:59 PM
We need the source of formmail.php.
bfwdesigns
08-13-2005, 08:40 PM
Thanks. I just sent it you via pm. Let me know if you see anything out of wack... :)
whoiscartpro
08-16-2005, 08:53 AM
You can use the php code below by editing yourself
<HEAD>
<TITLE>Your Website Name</TITLE>
</HEAD>
<BODY>
<?php
if ($_POST['submit'] == TRUE) {
$receiverMail = "you@yourdomainname.com";
$name = stripslashes(strip_tags($_POST['name']));
$email = stripslashes(strip_tags($_POST['email']));
$subject = stripslashes(strip_tags($_POST['subject']));
$msg = stripslashes(strip_tags($_POST['msg']));
$ip = $_SERVER['REMOTE_ADDR'];
$msgformat = "From: $name ($ip)\nE-mail: $email\n\n$msg\n";
if(empty($name) || empty($email) || empty($domain) || empty($subject) || empty($msg)) {
echo "<b>ERROR!</b><br>Missing information.<br><br>";
}
elseif(!ereg("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$", $email)) {
echo "<b>ERROR!</b><br>E-mail you entered is wrong.<br><br>";
}
elseif(mail($receiverMail, $subject, $msgformat, "From: $name <$email>")) {
echo "<b>Thank You!</b><br>Your message have sent. Thank you for contacting us.<br><br>"; }
else {
echo "<b>ERROR!</b>Please back and try again.<br><br>";
}
}
else { ?>
<TABLE BORDER=0 CELLSPACING=1 CELLPADDING=6 width=85%>
<form method="post" action="">
<TR>
<TD VALIGN=top align=right><B><label for="name">Name:</label></B></TD><TD><input id="name" name="name" type="text" size="30" /></TD>
</TR>
<TR>
<TD VALIGN=top align=right><B><label for="email">E-mail:</label></B></TD><TD><input id="email" name="email" type="text" size="30" /></TD>
</TR>
<TR>
<TD VALIGN=top align=right><B><label for="subject">Subject:</label></B></TD><TD><input id="subject" name="subject" type="text" size="30" /></TD>
</TR>
<TR>
<TD align=right valign=top><B><label for="message">Message:</label></B></TD>
<TD><textarea id="message" name="msg" rows="6" style="z-index:2; width: 350;"></textarea></TD>
</TR>
<TR><TD></TD><TD><label for="submit"></label><INPUT id="submit" TYPE=submit name="submit" value="Submit"></TD></TR>
</TABLE>
</form>
<?php } ?>
</BODY>
</HTML>
Froggy
08-16-2005, 11:04 AM
You should also check the length of the strings to make sure they are reasonable.