DNForum - Domain Sales, Domain Forum, Domain Appraisals, Domain Registrars
DNForum - Domain Sales, Domain Forum, Domain Appraisals, Domain Registrars
Quick Search:  
Register Now! Welcome to Dnforum.com You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact us.
Go Back   DNForum - Domain Sales, Domain Forum, Domain Appraisals, Domain Registrars > Content Development > Website Development and Design Discussion > Coding/Programming/Languages
Register Domains for $6.99 - GoDaddy.com
Reply
 
LinkBack Thread Tools Display Modes
Old 03-24-2008, 02:49 PM   #1 (permalink)
Platinum Lifetime Member
 
Last Online: 05-09-2008 11:45 PM
iTrader: (4)
Join Date: Mar 2007
Posts: 24
DNF$: 60
Location: usa
Country:


Looking For Help With Contact Form

Hi

I need some help with a php style contact form.

I tried to find a few free ones with no luck.

Its for a site I own and I need a contact form on the site.

Any help is appreciated.
domainpark is offline   Reply With Quote
Old 03-24-2008, 07:52 PM   #2 (permalink)
Platinum Lifetime Member
 
Makis77's Avatar
 
Name: Makis
Last Online: Yesterday 05:12 PM
iTrader: (8)
Join Date: Sep 2006
Posts: 448
DNF$: 365
Location: Glifada
Country:


i found a free one that works,
pm me for more.
__________________
United-Kingdom.org FOR SALE!

All offers are valid for 24 hours(1 day) from the posting time
Makis77 is offline   Reply With Quote
Old 04-27-2008, 07:49 AM   #3 (permalink)
Web Designer
 
MikeK's Avatar
DNF Verified Member
Verified Member
 
Name: Michael Kane
Last Online: 05-14-2008 11:46 AM
iTrader: (7)
Join Date: Aug 2006
Posts: 209
DNF$: 31,607
Location: Michigan
Country:



Why use a free one when a little code can have your form up and running. I'm gonna go out of my way and show you how it's done, whether you read this and learn from it is up to you, hope this helps someone who reads it in the future.

[in the contact page or the page in which you want to present your form, add the folowing]
<form method="post" action="contact.php"> -- [contact.php being the file we will create later]
[Add your fields in here]
Demo Field <INPUT TYPE="text" NAME="demo" SIZE="10"> [this is an example of how one of your fields would look like, remember to add a Name tag]
<input name="submit" type="submit" value="Submit" /> [add this after you have inserted all your form fields above]
</form> -- [close your form, obviously]

Now the part most people screw up on. It's simple and easy to understand.

First, create a file called contact.php as stated above. (create an ok.htm page this will be the page the user is redirected to if the form is sent successfully. Create an error.htm page also with a custom error message or the form with highlighted fields that should have been filled if the form is not sent)

Add the following into contact.php:
PHP Code:
<?php
$EmailTo 
"youremail@yourdomain.com";
$demo Trim(stripslashes($_POST['demo'])); 

$Body "";
$Body .= "demo: ";
$Body .= $demo;
$Body .= "\n";

$success mail($EmailTo$demo$Body);
if (
$success){
  print 
"<meta http-equiv=\"refresh\" content=\"0;URL=ok.htm\">";
}
else{
  print 
"<meta http-equiv=\"refresh\" content=\"0;URL=error.htm\">";
}
?>

Hope that helps...
__________________
Michael Kane / MikeK
Web Dev/Designer
DNForum Blog
MikeK is offline   Reply With Quote
Old 05-07-2008, 11:03 AM   #4 (permalink)
Platinum Lifetime Member
 
Name: Jason
Last Online: 05-10-2008 12:43 AM
iTrader: (10)
Join Date: Nov 2006
Posts: 490
DNF$: 5,125
Location: USA
Country:


PM me if you are looking for a professional solution.
JRBHosting is offline   Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT -4. The time now is 12:03 AM.
Copyright @2001-2008 DNForum.com