Register  |  Login



Question

Status: Closed Points: 250 Time: 14:09 - Jun 26, 2009  

Newbie123

PHP Contact Form

I would like a PHP Contact Form that would be simple for me to edit and use for my business site that runs on windows.

Thanks

Newbie

Answer Discussion
Tutorials

 

Q&A System for Websites and Corporate Collaboration

Advertisement

  • Generates significant organic traffic for websites
  • Saves companies money, resources, and time

Mason

Date:: Jun 26, 2009

Time:: 14:12

Ah i was just going thru my old php files and found this:

<?php
/* Simple PHP Contact Form By Mason Soiza */

/* Subject and Email Variables */

 $emailSubject = 'Program Request';
 $webMaster = 'order@elite-coderz.com';
 
/* Gathering Data Vairables */

 $email = $_POST['email'];
 $name = $_POST['name'];
 $phone = $_POST['phone'];
 $budget = $_POST['budget'];
 $travelers = $_POST['travelers'];
 $comments = $_POST['comments'];
 $newsletter = $_POST['newsletter'];

 $body = <<<EOD
<br><hr><br>
Email: $email <br>
Name: $name <br>
Phone Number: $phone <br>
Budget: $budget <br>
Number Of Travelers: $travelers <br>
Comments: $comments <br>
Newsletter: $newsletter <br>
EOD;

 $headers = "From: $email\r\n";
 $headers .= "Content-type: text/html\r\n";
 $success = mail($webMaster, $emailSubject, $body, $headers);
 
 
/* Results Rendered as HTML */

 $theResults = <<<EOD
<html>
<head>
<title>Sent Email</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
body {
 background-color: #f1f1f1;
 font-family: Verdana, Arial, Helvetica, sans-serif;
 font-size: 12px;
 font-style: normal;
 line-height: normal;
 font-weight: normal;
 color: #666666;
 text-decoration: none;
}
-->
</style>
</head>

<div>
<div align="left">Thank you for your interest! Your email will be answered very soon!</div>
</div>
</body>
</html>
EOD;
echo "$theResults";
?>

ed

Date:: Sep 15, 2009

Time:: 13:22

Adding a comment about the above in case any one finds this via a search (as i did). Be EXTREMELY cautious with the code above. It has no input validation and using it will at some point turn your server into a spam relay.

Mason

Date:: Sep 15, 2009

Time:: 13:24

"Adding a comment about the above in case any one finds this via a search (as i did). Be EXTREMELY cautious with the code above. It has no input validation and using it will at some point turn your server into a spam relay."

Man he asked for a simple contact form and i gave him that

Question Answered

This question has been closed, and points have been rewarded to the following experts:


Mason: 250

You're welcome however to comment or give additional information or if you wish, you have the ability to write a Tutorial in the Tutorial Area.

Answer this Question

New User

Email:

Upon submission of this form, you will automatically be registered as a Quomon user and we will send your login information to this address

Registered User

Username:

Password:

Forgot Your Password?

No tutorials have been submitted yet. Want to be the first?

Answer this Question

New User

Email:

Upon submission of this form, you will automatically be registered as a Quomon user and we will send your login information to this address

Registered User

Username:

Password:

Forgot Your Password?

Ask a Question

Have a new question? Ask!

You have 100 characters to use



Top Experts

View More

Rank

Expert

Points

1.

nidhi

9829

2.

oracleofDelphi

6493

3.

rcastagna

5596

4.

LAGM

4773

5.

PeterNZ

3487

6.

gonzalo

2765

7.

Mason

2520

8.

jgivoni

2303

9.

xarcus

1820

10.

Anpanman

917

Become an Expert

Register today to share your knowledge with the community and be recognized and rewarded for your contributions.


Register Here




"Psst, Quomon is a great site. Pass it on."     Tell a Friend  |   Link To Us  |   Save to Delicious  |   Digg! Digg it



Language Options

English:

www.quomon.com

Español:

www.quomon.es