[advanced search]
 

Go Back   NamePros.com > Discussion > Web Design & Development > Programming

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


Closed Thread
 
LinkBack Thread Tools
Old 12-14-2005, 10:33 AM   #1 (permalink)
Senior Member


 
Joseph's Avatar
 
Join Date: Dec 2004
Location: Ireland
Posts: 2,639
299.60 NP$ (Donate)

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, 10:41 AM   #2 (permalink)
Senior Member
 
Morph's Avatar
 
Join Date: Jul 2005
Location: England
Posts: 4,589
11.29 NP$ (Donate)

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

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.
__________________
Product for SELL
Product for SALE
Morph is online now  
Old 12-14-2005, 10:49 AM   #3 (permalink)
Senior Member


 
Joseph's Avatar
 
Join Date: Dec 2004
Location: Ireland
Posts: 2,639
299.60 NP$ (Donate)

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, 11:33 AM   #4 (permalink)
NPQ's PA, Slave, and On Call Coder

Technical Services


 
Eric's Avatar
 
Join Date: Mar 2005
Posts: 4,545
0.71 NP$ (Donate)

Eric has a reputation beyond reputeEric has a reputation beyond reputeEric has a reputation beyond reputeEric has a reputation beyond reputeEric has a reputation beyond reputeEric has a reputation beyond reputeEric has a reputation beyond reputeEric has a reputation beyond reputeEric has a reputation beyond reputeEric has a reputation beyond reputeEric has a reputation beyond repute

Save a Life Child Abuse 9/11/01 :: Never Forget Baby Health Marrow Donor Program AIDS/HIV Breast Cancer Cystic Fibrosis Ethan Allen Fund Animal Cruelty Ethan Allen Fund Ethan Allen Fund Cancer Alzheimer's Protect Our Planet Cancer Survivorship SIDS Child Abuse
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($comments, 70, "<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>
    </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";

?>
That should do the trick =)


-Eric
__________________

Last edited by SecondVersion; 12-14-2005 at 11:42 AM. Reason: Ha! Those damn $.. forgot one ;)
Eric is offline  
Old 12-14-2005, 11:34 AM   #5 (permalink)
Joe
Senior Member
 
Join Date: Oct 2005
Location: Kent ~ U.K.
Posts: 3,246
88.85 NP$ (Donate)

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)
Joe is offline  
Old 12-14-2005, 11:36 AM   #6 (permalink)
Senior Member


 
Joseph's Avatar
 
Join Date: Dec 2004
Location: Ireland
Posts: 2,639
299.60 NP$ (Donate)

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, 11:46 AM   #7 (permalink)
NPQ's PA, Slave, and On Call Coder

Technical Services


 
Eric's Avatar
 
Join Date: Mar 2005
Posts: 4,545
0.71 NP$ (Donate)

Eric has a reputation beyond reputeEric has a reputation beyond reputeEric has a reputation beyond reputeEric has a reputation beyond reputeEric has a reputation beyond reputeEric has a reputation beyond reputeEric has a reputation beyond reputeEric has a reputation beyond reputeEric has a reputation beyond reputeEric has a reputation beyond reputeEric has a reputation beyond repute

Save a Life Child Abuse 9/11/01 :: Never Forget Baby Health Marrow Donor Program AIDS/HIV Breast Cancer Cystic Fibrosis Ethan Allen Fund Animal Cruelty Ethan Allen Fund Ethan Allen Fund Cancer Alzheimer's Protect Our Planet Cancer Survivorship SIDS Child Abuse
Quote:
Originally Posted by Joseph
SV - PM me your paypal bro
Nah, don't worry about it
__________________
Eric is offline  
Old 12-14-2005, 12:08 PM   #8 (permalink)
Senior Member


 
Joseph's Avatar
 
Join Date: Dec 2004
Location: Ireland
Posts: 2,639
299.60 NP$ (Donate)

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, 04:57 PM   #9 (permalink)
Senior Member
 
JoshHendo's Avatar
 
Join Date: Apr 2005
Location: Australia
Posts: 1,099
48.40 NP$ (Donate)

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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


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 10:40 PM
PHP Contact Form (/w Error Checking, Multi-EMails, Mysql) iNod Free Resources 0 08-08-2005 02:41 PM
form filling script needed Guzey Web Design Discussion 0 04-10-2005 10:05 AM
simple redirect html/php wanted... DNQuest.com Website Development 5 07-24-2003 11:05 PM

Site Sponsors
Advertise your business at NamePros

All times are GMT -7. The time now is 07:11 AM.


Powered by: vBulletin® Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0
Template-Modifications by TMS
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85