Jump to content

Archived

This topic is now archived and is closed to further replies.

ItsWesYo

Help with contact form

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.

Share this post


Link to post
Share on other sites
change [code]include ("http://www.evermoreforums.com/wes/contact2.php"); [/code]
to[code]include ("contact2.php"); [/code]

Share this post


Link to post
Share on other sites

×

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.