Jump to content


Photo

Help with contact form


  • Please log in to reply
2 replies to this topic

#1 ItsWesYo

ItsWesYo
  • Members
  • PipPipPip
  • Advanced Member
  • 110 posts

Posted 31 July 2006 - 06:28 PM

contact.php
<?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; }

}
?>

contact1.php (the form)
<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>

contact2.php (submits the form)
<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>

The problem:
Everytime I fill out the form and submit it ... it comes up with the error message.

#2 ItsWesYo

ItsWesYo
  • Members
  • PipPipPip
  • Advanced Member
  • 110 posts

Posted 31 July 2006 - 08:08 PM

Sorry for the bump >_>

#3 sasa

sasa
  • Staff Alumni
  • Advanced Member
  • 2,804 posts
  • LocationHrvatska

Posted 31 July 2006 - 08:36 PM

change
include ("http://www.evermoreforums.com/wes/contact2.php");
to
include ("contact2.php");





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users