Apache2Triad Help, Support and Development Forum Index Search Profile Log in to check your private messages Log in Register Memberlist Attachments Statistics Crew/Ranks Archive
 contact.php form
Post new topic Reply to topic
Author Message

Joined: 03 May 2006
Posts: 47

PostPosted: Sat Jul 15, 2006 8:10 pm Reply with quoteBack to top

I have been working on a simple contact page and everything works until i try to submit a comment. Then my page displays an ERROR.


<table width="400" border="0" align="center" cellpadding="3" cellspacing="1">
<td><strong>Contact Form </strong></td>

<table width="400" border="0" align="center" cellpadding="0" cellspacing="1">
<td><form name="form1" method="post" action="send_contact.php">
<table width="100%" border="0" cellspacing="1" cellpadding="3">
<td width="16%">Subject</td>
<td width="2%">:</td>
<td width="82%"><input name="subject" type="text" id="subject" size="50"></td>
<td><textarea name="detail" cols="50" rows="4" id="detail"></textarea></td>
<td><input name="name" type="text" id="name" size="50"></td>
<td><input name="customer_mail" type="text" id="customer_mail" size="50"></td>
<td><input type="submit" name="Submit" value="Submit"> <input type="reset" name="Submit2" value="Reset"></td>


// Contact subject
$subject ="$subject";
// Details

// Mail of sender
// From
$header="from: $name <$mail_from>";

// Enter your email address
$to ='someone@somewhere.com';


// Check, if message sent to your email
// display message "We've recived your information"
echo "We've recived your contact information";
else {
echo "ERROR";

View user's profileSend private messageAIM Address

Joined: 21 Aug 2005
Posts: 148
Location: Romania, Pitesti

PostPosted: Mon Jul 31, 2006 10:00 am Reply with quoteBack to top

try this one if you have problems please reply

<form action="send.php" method="post">
Name:<input type="text" name="name" value="Yourname" /><br>
Email:<input type="text" name="email" value="name@site.tld" /><br>
Subject:<input type="text" name="subject" value="Subject" /><br>
Message:<textarea style="width:200px;height:200px" name="message">Your message !</textarea><br>
<input type="submit" value="Send" /><input type="reset" />


echo('<font color="red">Please type your name !</font>');
} elseif(!$email){
echo('<font color="red">Please type your email address !</font>');
} elseif(!$subject){
echo('<font color="red">Please type a subject !</font>');
} elseif(!$message){
echo('<font color="red">Please type a message !</font>');
} else {
$to = 'youremailaddress@site.tld';
$msg = 'Message from: '.$_POST['name'].' Message: '.$_POST['message'].'';
mail($to, $_POST['subject'], $msg, 'FROM: '.$_POST['email'].'');
echo('Thank you '.$_POST['name'].'');
View user's profileSend private messageSend e-mailYahoo Messenger

Joined: 01 Jun 2007
Posts: 7

PostPosted: Fri Jun 01, 2007 8:38 am Reply with quoteBack to top

I made a contact form when I used to run http://pctech.4net.gr

View user's profileSend private message
Display posts from previous:      
Post new topic Reply to topic

 Jump to:   

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum
Powered by phpBB © 2001, 2002 phpBB Group :: FI Theme
All times are GMT