This page looks plain and unstyled because you're using a non-standard compliant browser. To see it in its best form, please upgrade to a browser that supports web standard_personals. It's free and painless.

Build A Website Blog

PHP Form Processor - Link Exchange Form - Part 2

Skip | 23 December, 2004 18:38

Here is the second part of our PHP script form processor for a visitor to fill out a form on your site to request a reciprocol link.

Yesterday's post (part 1) created the actual form a visitor would submit.

Today's code is the actual forum processor and confirmation page that the visitor sees after they hit Submit from the first form.

First, put this php code ABOVE the tag - generally at the very top of your page code:

___________________

<?php
$SiteName = "Your Site Name Here";
$SiteEmail = "Your contact email address here";
$ThankYouMessage = "Thank You From Your Site Here.";
$SiteUserName = "Your Site Name Here";
?>

__________________

Next, put this code, starting with "A confirmation..." down to this tag - ?>

__________________

A confirmation email was sent to: 

<?php
$UserMessage = "$UserName, Thank you for submiting your Link Information to $SiteName.n";
$UserMessage .= "If needed, we will respond back with 48 hours.n";
$UserMessage .= "If you have any questionsn";
$UserMessage .= "please email us at:  $SiteEmailnn";
$UserMessage .= "$SiteUserNamen $SiteName Administration n $SiteEmail";
mail("$UserEmail", "$ThankYouMessage", $UserMessage, "From: $SiteEmail");
$AdminMessage .= "Name: $UserNamen";
$AdminMessage .= "Email: $UserEmailn";
$AdminMessage .= "Return Link: $UserLinkn";
$AdminMessage .= "URL: $UserUrln";
$AdminMessage .= "Description: $UserDesn";
$AdminMessage .= "";
$AdminMessage .= "$HTTP_USER_AGENTn";
mail("$SiteEmail", "$SiteName - Contact Submission", $AdminMessage, "From: $UserEmail");
?>

____________________

Generally, you'll want to put the second set of code into your page inside your tables or in the center of the page.  Once complete, name this file "email1.php".  You can actually name it whatever you want, but you'll also have to have the file name in the very first line of yeserday's code.

The beauty of this form is it accomplishes two key objectives:

  1. It gives the submitter a visual confirmation of their submission.
  2. It sends both them and you confirmation emails

You will know when someone has submitted a link request to you, and the visitor / submitter will know that your website received the correct information.

That's it for today gang!

Be sure to post any comments below where it says "Comment".  You can choose to be anonymous.  We'd love to hear from you!

Skip


Comments for post

 
Build A Website | Javascript | HTML Help | Persuasive Copywriting | HTML Form | Simple eMail Form | Build A Website Map