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. 09: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

Understanding Levels
Understanding Levels
- Adobe Photoshop -
Screws & Rivets
Screws & Rivets
- Adobe Photoshop -
The Metal Effect
The Metal Effect
- Adobe Photoshop -
Choppy Seas
Choppy Seas
- Adobe Photoshop -

Username:
Password:  
Remember Me

Lost Password? || Register

  
Download Source File
Printer Friendly Version
Tell A Friend v2.0
   
 [WIP] Hairdresser Site Design
Author: YinToniq
Posted: Jul 03rd, 5:58am
Activity: 1 replies, 42 views
Simple Flash Help Needed (AS2)
Author: stiney51
Posted: Jul 02nd, 2:40pm
Activity: 9 replies, 57 views
Transformers
Author: Jacorre
Posted: Jun 29th, 6:33pm
Activity: 2 replies, 76 views
 Quick question about Jasc PaintShop Pro 9.
Author: Rydium-41
Posted: Jun 28th, 8:21pm
Activity: 2 replies, 76 views
I bought film today!!
Author: NikonErik
Posted: Jun 27th, 12:04am
Activity: 2 replies, 77 views
New Battle
Author: MoodsR4Cattle
Posted: Jun 26th, 6:28pm
Activity: 2 replies, 86 views
Image Loading
Author: funkyfela
Posted: Jun 22nd, 9:00pm
Activity: 1 replies, 85 views
Headshot Critique Please
Author: NikonErik
Posted: Jun 19th, 11:32pm
Activity: 6 replies, 155 views
 imagecopy() and imagecopyresized() problem
Author: thatpyrokid
Posted: Jun 18th, 3:05pm
Activity: 1 replies, 151 views
Problem With Regitration Code...?
Author: RXS
Posted: Jun 17th, 3:18am
Activity: 2 replies, 153 views
Topaz Labs do it again!
Author: Tamlin
Posted: Jun 17th, 12:08am
Activity: 5 replies, 231 views
[Photoshop] Anime Coloring Tutorial
Author: Wavechan
Posted: Jun 16th, 3:47pm
Activity: 2 replies, 293 views
--- Site Resources ---
Total Tutorials:212
Total Downloads:    415
Linkbase Links:

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