phpHostingDeals

CALL NOW!(ID:85470)
+1-855-211-0932
HomeEmailImplementing phpmail in FrontPage 2000/2003 contact forms

Implementing phpmail in FrontPage 2000/2003 contact forms

Our server architecture does not support contact forms created with FrontPage, using the webbot feature to submit form results. There is, however, a way for you to add a contact form on your website even if you have created it using FrontPage. You have to create a PHP contact form that uses the phpmail() function to send e-mails. This article explains how you can achieve this. Start your FrontPage and show the 'Forms' toolbar. To turn this toolbar on, go to View > Toolbars > Forms. You can also right-click on any current toolbar and select the Forms toolbar. You can move the toolbar around on your screen or dock it to the top, bottom, left or right. First, you need to create a new form on the page where all the form elements will be placed (your contact page):
  1. With your cursor on the first line below the "Ask a Question:" header, click on the "Insert Form" button in the Forms toolbar. FrontPage inserts an empty form with a Submit and Reset button into your page.
  2. Right-click anywhere on your new form and choose Form Properties.
  3. Change the "Form Name:" to "contact"
  4. Click on the Options button.
  5. In the "Action:" box, type "form.php"
  6. Click OK to save your options.
  7. Click OK again to save your changes to the Form Properties.
When you are done, your HTML code should look like this:
<form method="POST" action="form.php" name="contact">
<p><input type="submit" value="Submit" name="B1"><input type="reset" value="Reset" name="B2"></p> </form>
Note that it is a very simple HTML code. In the future, it might be easier to edit the FORM tag directly in the HTML code rather than using the Form Properties window in FrontPage. The form.php file should be placed in the same directory as the contact form and should contain the following code:
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
<?php

$MailToAddress = "mail@my-best-domain.com"; // your email address - must be hosted with us, i.e. present in your E-Mail Manager
$redirectURL = "thankyou.htm"; // the URL of the thank you page.
$MailSubject = "Contact Form"; // the subject of the message you will receive
$MailToCC = ""; // CC (carbon copy) also send the email to this address (leave empty if you won't use it)
$Message = "";
    if (!is_array($HTTP_POST_VARS))
    return;
reset($HTTP_POST_VARS);
 while(list($key, $val) = each($HTTP_POST_VARS)) {
  $GLOBALS[$key] = $val;
  if (is_array($val)) { 
   $Message .= "<br><b>$key:</b> ";
   foreach ($val as $vala) { 
    $vala =stripslashes($vala);
    $Message .= "$vala, ";
   } 
   $Message .= "<br>";
  }  
  else {
   $val = stripslashes($val);
   if (($key == "Submit") || ($key == "submit")) { }  
   else {  if ($val == "") { $Message .= "$key: - <br>"; }
     else { $Message .= "<b>$key:</b> $val<br>"; }
   }
  }
 } // end while
$Message = "n<font face=verdana size=2>".$Message;
mail( $MailToAddress, $MailSubject, $Message, "Content-Type: text/html; charset=ISO-8859-1rnFrom: ".$email."rnBCc: ".$MailToCC);
header("Location: ".$redirectURL);
?>