TUTORIALS SUBMENU ---->

PHOTOSHOP    FLASH    ILLUSTRATOR    BLENDER    CINEMA 4D    WEB-CODING

Contact Forms


Last 5 User Comments

view entire thread

User:  Hooch (#23671)
Date: Tue Feb 07, 2006. 00:28:47

Post #3 of 3

This looks like a great form 72.
Now how do I implement this? I copied the whole code and made the contact.php file.
Since I can't directly link to it..I changed the name to contact1.php. I then could see the page, and I got it to send an email. But ofcourse the link back didn't work.
So how does this work with my site?
The main page will be an html.
I hope I am clear enough.
TY, Hooch

Reply to this post


User:  scrowler (#19667)
Date: Mon Oct 31, 2005. 10:09:36

Post #2 of 3

why not write this up as an "advanced contact forms" tutorial and submit it?

Reply to this post


User:  72dpi (#18222)
Date: Fri Sep 02, 2005. 08:09:13

Post #1 of 3

Here is the same method that I use,
It also includes a autoresponse.

just change the content as needed.





Untitled Document




// keep people from accessing this page directly
if (eregi('contact.php', $_SERVER['PHP_SELF'])) {
// go to index page
header('Location: ../main.php?page=contact');
die();
}

?>

Contact Form


echo "

* Denotes required fields.

";

// put your email here
$send_to = "youremail@your.com";

// This is what is displayed in the email subject line
$subject = "Message from Your Website";

// This is displayed if all the fields are not filled in
$empty_fields_message = "

Please go back and complete all the fields in the form!

";

// This is displayed when the email has been sent
$thankyou_message = "

Thankyou. Your message has been sent! =)

<< Back to Main

";

// set up info
$nowDay=date("m.d.Y");
$nowClock=date("H:i:s");
$http_referrer = getenv( "HTTP_REFERER" );

// You do not need to edit below this line

$name = stripslashes($_POST['txtName']);
$email = stripslashes($_POST['txtEmail']);
$phone = stripslashes($_POST['txtPhone']);
$message = stripslashes($_POST['txtMessage']);

if (!isset($_POST['txtName'])) {

?>



Name: *


Email: *



Phone:



Contact?



Yes


No

How did you find us?


Advertisement

Word of Mouth

Search Engine

Web Link

Other

Message: *



 



}
elseif (empty($name) || empty($email) || empty($message)) {

echo @$empty_fields_message;
}
else {
// Stop the form being used from an external URL
// Get the referring URL
@$referer = $_SERVER['HTTP_REFERER'];
// Get the URL of this page
@$this_url = "http://".$_SERVER['HTTP_HOST'].$_SERVER["REQUEST_URI"];
// If the referring URL and the URL of this page don't match then
// display a message and don't send the email.
if ($referer != $this_url) {
echo "You do not have permission to use this script from another URL.";
exit;
}
@$messageproper =

// we now generate a nice form for emailing
"Message recieved: $nowDay at $nowClock:\n\n" .
"Email Sent From: $http_referrer\n\n" .
"Name: $name\n\n".
"Email: $email\n\n".
"Phone Number: $phone\n\n".
"Contact?: $contact\n\n".
"Found site By: $found\n\n".

"------------------------ COMMENTS ------------------------\n\n\n" .

$message .

"\n\n\n----------------------------------------------------------\n" ;
// The URLs matched so send the email
mail($send_to, $subject, $messageproper, "From: $name <$email>");

# Autoresponder #############################################################
// note , the . (dot) joins two strings. to end a string, use semi-colon ;
$replysubject =
"Query from Your Website" ; // send our subject header
$replymessage =
"Dear " .
$name .
"\n\nThank you for your email. \nIf you had so requested, we will get back to you as soon as possible. " .
"\n\nRegards," .
"\n Your Name Here" .

mail( "$email", "$replysubject", "$replymessage\n\n", "From:$send_to" );
// Display the thankyou message
echo $thankyou_message;

}

?>





Hope it helps

Reply to this post


--- View Entire Thread ---


FEATURED TUTORIALS & GUIDES

view all

Pseudo-3D Boxes
Pseudo-3D Boxes
- Adobe Photoshop -
Metal Meshes
Metal Meshes
- Adobe Photoshop -
Painting An Eye
Painting An Eye
- Adobe Photoshop -
Metallic Pill Butt...
Metallic Pill Butt...
- Adobe Photoshop -

Username:
Password:  
Remember Me

Lost Password? || Register

  
Download Source File
Printer Friendly Version
Tell A Friend v2.0
   
High Quality Web Templates for low cost
Author: JhonSmithi
Posted: Dec 01st, 11:49am
Activity: 0 replies, 14 views
 Metropolix washere ....
Author: metropolix
Posted: Nov 30th, 4:53am
Activity: 0 replies, 49 views
import vector art into paintshop pro?
Author: agentxi
Posted: Nov 29th, 12:27am
Activity: 1 replies, 57 views
Video Ranking
Author: Nitewalker
Posted: Nov 28th, 4:34pm
Activity: 2 replies, 66 views
Free Clipart and Illustrator Symbols Site
Author: southoc
Posted: Nov 28th, 4:29am
Activity: 1 replies, 84 views
 i am looking for good quality of market place
Author: ashuthosh
Posted: Nov 27th, 6:19am
Activity: 1 replies, 78 views
Current Project: space station
Author: Boo.j2
Posted: Nov 26th, 12:32pm
Activity: 4 replies, 118 views
Any tips for a precision?
Author: dutchMasta
Posted: Nov 26th, 9:51am
Activity: 10 replies, 210 views
--- Site Resources ---
Total Tutorials:210
Total Downloads:    413
Linkbase Links:243

Design & Content © BioRUST 2008 :: PRIVACY STATEMENT :: LEGAL INFORMATION :: ADVERTISING MEDIA KIT
:: BIORUST AFFILIATES -->
DividerDividerDividerDivider