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
Google
Post new topic Reply to topic
Author Message
QWERTYtech
 
 


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.



contact.php
Code:

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

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



send_contact.php
Code:

<?php
// Contact subject
$subject ="$subject";
// Details
$message="$detail";

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

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

$send_contact=mail($to,$subject,$message,$header);

// Check, if message sent to your email
// display message "We've recived your information"
if($send_contact){
echo "We've recived your contact information";
}
else {
echo "ERROR";
}
?>


http://redbeardcustoms.no-ip.info/WebSite/contact.php
View user's profileSend private messageAIM Address
cigraphics
 
 


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
Code:

<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" />
</form>


send.php
Code:

<?php
if(!$name){
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
invisible-root
 
 


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

Enjoy.
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