NamePros
Welcome, Guest! Ready to make a name for yourself in the domain business? We welcome both the hobbyist and professional domainer to join the discussion as part of the NamePros community.

Click here to create your profile to start earning reputation for posting, and trader ratings for buying & selling in our free e-marketplace. Build your trader rating with each successful sale. Our system has tracked over 100,000 sales and counting!
FAQ & TOS Register Search Today's Posts Mark Forums Read

Go Back   NamePros.com > Website Development Discussion Forums > Programming
Reload this Page {Wanted} Simple Contact form

Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics.

Advanced Search


Closed Thread
 
LinkBack Thread Tools
Old 12-14-2005, 11:33 AM THREAD STARTER               #1 (permalink)
Senior Member
 
Joseph's Avatar
Join Date: Dec 2004
Location: Ireland
Posts: 2,684
Joseph has a reputation beyond reputeJoseph has a reputation beyond reputeJoseph has a reputation beyond reputeJoseph has a reputation beyond reputeJoseph has a reputation beyond reputeJoseph has a reputation beyond reputeJoseph has a reputation beyond reputeJoseph has a reputation beyond reputeJoseph has a reputation beyond reputeJoseph has a reputation beyond reputeJoseph has a reputation beyond repute
 


Animal Cruelty 9/11/01 :: Never Forget Find Marrow Donors! Save The Children Save The Children Save The Children Ethan Allen Fund Baby Health Child Abuse Cancer AIDS/HIV Autism Autism Lou Gehrig's Disease (ALS) Parkinson's Disease Alzheimer's Cancer Save a Life Cancer Cancer Help The Homeless - Holiday 2009 Help The Homeless - Holiday 2009 Help The Homeless - Holiday 2009 Help The Homeless - Holiday 2009

{Wanted} Simple Contact form


Hey

i am looking for a simple php form that I can intergrate with my site. Must include the following:

name
email
comments

I would like the bit were i add my email to come in a seperate file like a config.php file so I can easily change it when necessary.

Paying $5 for a custom script

j
Joseph is offline  
Old 12-14-2005, 11:41 AM   #2 (permalink)
Senior Member
 
Morph's Avatar
Join Date: Jul 2005
Location: England
Posts: 4,570
Morph has a reputation beyond reputeMorph has a reputation beyond reputeMorph has a reputation beyond reputeMorph has a reputation beyond reputeMorph has a reputation beyond reputeMorph has a reputation beyond reputeMorph has a reputation beyond reputeMorph has a reputation beyond reputeMorph has a reputation beyond reputeMorph has a reputation beyond reputeMorph has a reputation beyond repute
 

Member of the Month
September 2006
Third World Education Animal Cruelty Multiple Sclerosis Child Abuse Find Marrow Donors! Cystic Fibrosis Save a Life Cancer Ethan Allen Fund
Why not google it, there are thousands of sites that offer you this code?

Seems a waste of $5 to me mate.
__________________
If you always do what you've always done, you'll always have what you've always had.
Morph is offline  
Old 12-14-2005, 11:49 AM THREAD STARTER               #3 (permalink)
Senior Member
 
Joseph's Avatar
Join Date: Dec 2004
Location: Ireland
Posts: 2,684
Joseph has a reputation beyond reputeJoseph has a reputation beyond reputeJoseph has a reputation beyond reputeJoseph has a reputation beyond reputeJoseph has a reputation beyond reputeJoseph has a reputation beyond reputeJoseph has a reputation beyond reputeJoseph has a reputation beyond reputeJoseph has a reputation beyond reputeJoseph has a reputation beyond reputeJoseph has a reputation beyond repute
 


Animal Cruelty 9/11/01 :: Never Forget Find Marrow Donors! Save The Children Save The Children Save The Children Ethan Allen Fund Baby Health Child Abuse Cancer AIDS/HIV Autism Autism Lou Gehrig's Disease (ALS) Parkinson's Disease Alzheimer's Cancer Save a Life Cancer Cancer Help The Homeless - Holiday 2009 Help The Homeless - Holiday 2009 Help The Homeless - Holiday 2009 Help The Homeless - Holiday 2009
want one for my site without having to leave credits for others
Joseph is offline  
Old 12-14-2005, 12:33 PM   #4 (permalink)
Senior Member
 
Eric's Avatar
Join Date: Mar 2005
Posts: 4,948
Eric Has achieved greatnessEric Has achieved greatnessEric Has achieved greatnessEric Has achieved greatnessEric Has achieved greatnessEric Has achieved greatnessEric Has achieved greatnessEric Has achieved greatnessEric Has achieved greatnessEric Has achieved greatnessEric Has achieved greatness
 

Member of the Month
MOTM September 2005
Save a Life Child Abuse 9/11/01 :: Never Forget Baby Health Marrow Donor Program AIDS/HIV Breast Cancer Animal Rescue Cystic Fibrosis Ethan Allen Fund Animal Cruelty Ethan Allen Fund Ethan Allen Fund Baby Health Cancer Alzheimer's Protect Our Planet Cancer Survivorship SIDS Child Abuse Diabetes Protect Our Planet Multiple Sclerosis Autism Adoption Special Olympics
How about I just write one on the spot?

contact.php
PHP Code:
<html>
<head>
<title>Contact</title>
</head>

<body>

<form method="post" action="contact.php">
Name: <br>
<input type="text" name="name"><br><br>
Email: <br>
<input type="text" name="email"><br><br>
Comments: <br>
<textarea name="comments" rows="10" cols="40"></textarea><br><br>
<input type="submit" name="submit" value="Submit">
</form>

<?php

if(isset($_POST['submit']))
{
  
//Let's Go ahead and include our config file containing the contact email
  
include("config.php");
  
  
//Grab all the data
  
$name trim(stripslashes($_POST['name']));
  
$email trim(stripslashes($_POST['email']));
  
$comments trim(stripslashes(strip_tags($_POST['comments'])));
  
$comments wordwrap($comments70"<br>\n");

  
//Check that the email is valid
  //Note: only checks the email for the _correct_ format "you@domain.com".
  //This doesn't necessarily mean it's a real email...heh
  
$validate preg_match('/^([a-zA-Z0-9])+([\.a-zA-Z0-9_-])*@([a-zA-Z0-9_-])+(\.[a-zA-Z0-9_-]+)+/'$email);
  
  if(!
$validate)
  {
    echo 
'<br>'.$email.' is not a valid email.<br>';
    exit();
  }
  else
  {
    
$e $email;
  }
  
  
//Check to make sure none of the fields are empty
  
if(!$name || !$e || !$comments)
  {
    echo 
'<br>All fields required, please enter all data.<br>';
    exit();
  }
  else
  {
    
//Commence to sending the form =)
    //To send HTML mail, we'll need to set the Content-type header
    
$headers  'MIME-Version: 1.0'."\r\n";
    
$headers .= 'Content-type: text/html; charset=iso-8859-1'."\r\n";
    
$headers .= 'From: '.$e."\r\n";
    
    
//Ok, now e-mail
    
$send mail($contact_email"Message from: $name""

    <html>
    <head>
    <meta http-equiv=\"Content-Language\" content=\"en-us\">
    <meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\">
    <title>Message from 
$name</title>
????: NamePros.com http://www.namepros.com/programming/148068-wanted-simple-contact-form.html
    </head>

    <body>
    <table cellpadding=\"2\" cellspacing=\"0\" width=\"400\" border=\"1\" style=\"border-collapse: collapse\">
    <tr>
      <td width=\"87\"><b>Name:</b></td>
      <td width=\"313\">&nbsp;
$name</td>
    </tr>
    <tr>
      <td width=\"87\"><b>Email:</b></td>
      <td width=\"313\">&nbsp;
$e</td>
    </tr>
    <tr>
      <td width=\"87\"><b>Comments:</b></td>
      <td width=\"313\">&nbsp;
$comments</td>
    </tr>
    </table>

    </body>
    </html>"
$headers);
    
    if(
$send)
    {
      echo 
'<br>Thank you '.$name.' for contacting us.<br>';
    }
    else
    {
      echo 
'<br>Sorry, your message could not be sent at this time.<br>Please try again later.<br>';
    }
  }
}
//And that is all =) Very simple really.
?>

</body>
</html>
config.php
PHP Code:
<?php

$contact_email 
"myemail@mydomain.com";
????: NamePros.com http://www.namepros.com/showthread.php?t=148068

?>
That should do the trick =)


-Eric
Last edited by SecondVersion; 12-14-2005 at 12:42 PM. Reason: Ha! Those damn $.. forgot one ;)
Eric is offline  
Old 12-14-2005, 12:34 PM   #5 (permalink)
Joe
Senior Member
Join Date: Oct 2005
Location: Kent ~ U.K.
Posts: 3,209
Joe has much to be proud ofJoe has much to be proud ofJoe has much to be proud ofJoe has much to be proud ofJoe has much to be proud ofJoe has much to be proud ofJoe has much to be proud ofJoe has much to be proud ofJoe has much to be proud ofJoe has much to be proud of
 


Save The Children Help The Homeless - Holiday 2009 Help The Homeless - Holiday 2009 Help The Homeless - Holiday 2009 Help The Homeless - Holiday 2009

will this do?


will this do?
no garantees though
if it does work, i'm charging nothing for it
if it doesn't... well it doesn't
and i hope u find something that does
but it wont!

you're prob better off using sv's
Attached Files
File Type: zip email.zip (895 Bytes, 2 views)
__________________
Myself and "JackHeskett" are no longer associated with FusedHosting.net. Please pipe all PMs to admin [at] fusedhosting.net.
Joe is offline  
Old 12-14-2005, 12:36 PM THREAD STARTER               #6 (permalink)
Senior Member
 
Joseph's Avatar
Join Date: Dec 2004
Location: Ireland
Posts: 2,684
Joseph has a reputation beyond reputeJoseph has a reputation beyond reputeJoseph has a reputation beyond reputeJoseph has a reputation beyond reputeJoseph has a reputation beyond reputeJoseph has a reputation beyond reputeJoseph has a reputation beyond reputeJoseph has a reputation beyond reputeJoseph has a reputation beyond reputeJoseph has a reputation beyond reputeJoseph has a reputation beyond repute
 


Animal Cruelty 9/11/01 :: Never Forget Find Marrow Donors! Save The Children Save The Children Save The Children Ethan Allen Fund Baby Health Child Abuse Cancer AIDS/HIV Autism Autism Lou Gehrig's Disease (ALS) Parkinson's Disease Alzheimer's Cancer Save a Life Cancer Cancer Help The Homeless - Holiday 2009 Help The Homeless - Holiday 2009 Help The Homeless - Holiday 2009 Help The Homeless - Holiday 2009
SV - PM me your paypal bro
Joseph is offline  
Old 12-14-2005, 12:46 PM   #7 (permalink)
Senior Member
 
Eric's Avatar
Join Date: Mar 2005
Posts: 4,948
Eric Has achieved greatnessEric Has achieved greatnessEric Has achieved greatnessEric Has achieved greatnessEric Has achieved greatnessEric Has achieved greatnessEric Has achieved greatnessEric Has achieved greatnessEric Has achieved greatnessEric Has achieved greatnessEric Has achieved greatness
 

Member of the Month
MOTM September 2005
Save a Life Child Abuse 9/11/01 :: Never Forget Baby Health Marrow Donor Program AIDS/HIV Breast Cancer Animal Rescue Cystic Fibrosis Ethan Allen Fund Animal Cruelty Ethan Allen Fund Ethan Allen Fund Baby Health Cancer Alzheimer's Protect Our Planet Cancer Survivorship SIDS Child Abuse Diabetes Protect Our Planet Multiple Sclerosis Autism Adoption Special Olympics
Originally Posted by Joseph
SV - PM me your paypal bro
Nah, don't worry about it
Eric is offline  
Old 12-14-2005, 01:08 PM THREAD STARTER               #8 (permalink)
Senior Member
 
Joseph's Avatar
Join Date: Dec 2004
Location: Ireland
Posts: 2,684
Joseph has a reputation beyond reputeJoseph has a reputation beyond reputeJoseph has a reputation beyond reputeJoseph has a reputation beyond reputeJoseph has a reputation beyond reputeJoseph has a reputation beyond reputeJoseph has a reputation beyond reputeJoseph has a reputation beyond reputeJoseph has a reputation beyond reputeJoseph has a reputation beyond reputeJoseph has a reputation beyond repute
 


Animal Cruelty 9/11/01 :: Never Forget Find Marrow Donors! Save The Children Save The Children Save The Children Ethan Allen Fund Baby Health Child Abuse Cancer AIDS/HIV Autism Autism Lou Gehrig's Disease (ALS) Parkinson's Disease Alzheimer's Cancer Save a Life Cancer Cancer Help The Homeless - Holiday 2009 Help The Homeless - Holiday 2009 Help The Homeless - Holiday 2009 Help The Homeless - Holiday 2009
Your a legend

Thanks!
Joseph is offline  
Old 12-14-2005, 05:57 PM   #9 (permalink)
Senior Member
 
JoshHendo's Avatar
Join Date: Apr 2005
Location: Australia
Posts: 1,092
JoshHendo is a jewel in the roughJoshHendo is a jewel in the roughJoshHendo is a jewel in the rough
 



Another good free one where you don't need to leave the credits is www.noviceform.com

-Josh
__________________
:bingo: :kickass: :lala: :notme: :great: :gn:
JoshHendo is offline  
Closed Thread


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


Similar Threads
Thread Thread Starter Forum Replies Last Post
What’s the biggest negative about the domain name game? slaughterbeck Domain Name Discussion 40 11-27-2005 11:40 PM
PHP Contact Form (/w Error Checking, Multi-EMails, Mysql) iNod Free Resources 0 08-08-2005 03:41 PM
form filling script needed Guzey Web Design Discussion 0 04-10-2005 11:05 AM
simple redirect html/php wanted... DNQuest.com Website Development 5 07-25-2003 12:05 AM

Liquid Web Smart Servers  
All times are GMT -7. The time now is 02:45 AM.

Managed Web Hosting by Liquid Web
Domain name forum recommended by Domaining.com Powered by: vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.6.0 Ad Management plugin by RedTyger