Forum Moderators: coopster

Message Too Old, No Replies

Form Send Problem

         

Programmers

1:11 pm on Sep 6, 2006 (gmt 0)

10+ Year Member



I had a perfectly working form on my website that allowed the users to submit jokes. Then, I added a category drop down box and ever since it doesn't work, but I think it should. However, I've never used a drop down box before, so this might be why I don't see the problem myself. Could someone please point me in the right direction please?

Here is the error that I get:

Warning: mail() [function.mail]: Could not execute mail delivery program '/usr/sbin/sendmail -t -i' in /home/******/public_html/entertainment/jokes/submitjoke.php on line 20

Here is the HTML form coding:

<form action="index.php?get=entertainment/jokes/submitjoke.php" method="POST">
Full Name <span class="red">*</span><br>
<input class="textarea" name="name" size="40" value="">
<br><br>

Joke Category <span class="red">*</span><br>
<select name="category">
<option value="select" selected>Choose A Category</option>
<option value="blondes">Blondes</option>
<option value="computers">Computers & The Internet</option>
<option value="general">General</option>
<option value="menandwomen">Men & Women</option>
</select>

<br><br>
Joke Title (This may be changed)<br>
<input class="textarea" name="title" size="40" value="">
<br><br>
Your Joke <span class="red">*</span><br>
<textarea class="textarea" name="joke" cols="52" rows></textarea>
<br><br>
<input type="submit" name="submit" value="Send" class="button">
</form>

Here is the PHP coding:

<?php

$name = trim($_POST['name']);
$joke = trim($_POST['joke']);
$title = $_POST['title'];
$category = $_POST['category'];
$myemail = "myemail@website.com";

if($name=="")
echo "<h1>An Error Has Occurred</h1><br>Please go back and enter your name.";

elseif($joke=="")
echo "<h1>An Error Has Occurred</h1><br>Please go back and enter your joke.";

elseif($category=="select")
echo "<h1>An Error Has Occurred</h1><br>Please go back and select a category for your joke.";

else
{
mail($myemail, "Joke Submission", "Name: $name\nCategory: $catagory\nJoke Title: $title\nJoke: $joke");
echo "<h1>Joke Submitted</h1><br>Thank you ";
echo "$name";
echo ". Your joke has been successfully submitted and will be reviewed for its addition to the website.";
}
?>

Thanks in advance,
Regards,
Tom.

scriptmasterdel

5:24 pm on Sep 6, 2006 (gmt 0)

10+ Year Member



To be honest, i'm no expert, but it looks like you will have to get help from your host. It is pretty clearly a problem with their setup which you will not be able to fix, because you do not have privileges to change their setup.

Del

Programmers

5:46 pm on Sep 6, 2006 (gmt 0)

10+ Year Member



Ugh... My host is always messing me about.