Jump to content

Help with contact form


ItsWesYo

Recommended Posts

[b]contact.php[/b]
[code]
<?php
include ("http://www.evermoreforums.com/wes/header.php");
$page = ((isset($_REQUEST['page']))?($_REQUEST['page']):(''));

switch($page)
{

case "sent": {
include ("http://www.evermoreforums.com/wes/contact2.php");
break; }

default: {
include ("http://www.evermoreforums.com/wes/contact1.php");
break; }

}
?>
[/code]

[b]contact1.php (the form)[/b]
[code]
<center>

<table><tr><td>

<form method="POST" action="?page=sent">

<b>1. Please select a type:</b><br>
<select name="type">
<option value="comment">Comment
<option value="error">Error
<option value="other">Other
<option value="quiz">Quiz
<option value="suggest">Suggestion
<option value="tutorial">Tutorial
</select><br><br>

<b>2. Please enter the content:</b><br>
<textarea rows="7" cols="25" name="content"></textarea><br><br>
<input type="submit" value="Submit" name="submit">

</form>

</td></tr></table>

</center>
[/code]

[b]contact2.php (submits the form)[/b]
[code]
<center>

<?php
if(isset($_POST['submit'])) {

$to = "wes@evermore.com";
$subject = "Contact Form";
$type = $_POST['type'];
$content = $_POST['content'];

$body = "Type: $type \n\n Content: $content";

echo "Thanks! I'll get back to you soon.";
mail($to, $subject, $body);

} else {

echo "It seems like there was an error with the form.";

}
?>

</center>
[/code]

[b]The problem:[/b]
Everytime I fill out the form and submit it ... it comes up with the error message.
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.