0

Hi
i am new to web developnment and fortuantely i was able to create a website for my friend

i have used dreamweaver to do the entire site in HTML
now i am using an enquiry form where a person types his info and submits the same which needs to go to my mail id in the script

i downloaded phpmailer-fe from sourceforge.net and included it into my code
but i am recieving an error which i understand head nor tail.

the site is www.iflchennai.in
in that please use the enquiry link to take u to the enquiry page
after typing data click on submit u will see the error page

i am including the coding below

* form.html ( this is my enquiry form)

<html>
<head>
<title>Enquiry Form</title>
<style>
body, p, table, th, td, div {
  font-family: Arial, Helvetica, sans-serif;
  font-size: 12px;
}
th {
  background-color:#0080C0;
  color:white;
  font-weight:bold;
  font-size:18px;
  border: 1px solid #0080C0;
}
input.text, textarea {
  font-family: Arial, Helvetica, sans-serif;
  font-size: 11px;
  width: 99%;
}
.text:focus, textarea:focus {
  background-color: #FFFACC;
  border: 1px solid #000000;
}
#mydiv {
  position: absolute;
  left: 50%;
  margin-left: -250px;
  width: 500px;
  text-align: left;
}
td.colone {
  text-align: right;
  vertical-align: top;
  padding-top:4px;
#  border-top: 1px solid #0080C0;
#  border-bottom: 1px solid #0080C0;
#  border-left: 1px solid #0080C0;
}
td.coltwo {
  color:red;
  text-align: center;
  vertical-align: top;
  padding-top:6px;
#  border-top: 1px solid #0080C0;
#  border-bottom: 1px solid #0080C0;
}
td.colthree {
#  border-top: 1px solid #0080C0;
#  border-bottom: 1px solid #0080C0;
#  border-right: 1px solid #0080C0;
}
table.border {
  border: 1px solid #0080C0;
  border-collapse: collapse;
}
</style>
</head>
<body>
<div id="mydiv">
<form method="POST" action="_lib/phpmailer-fe.php" enctype="multipart/form-data">
<input type="hidden" value="form.html" name="referer">
<table class="border" width="500" cellpadding="3" cellspacing="0">
  <tr>
    <th colspan="3">Enquiry Form</th>
  </tr>
  <tr>
    <td colspan="3"><div style="height:5px;"></div></td>
  </tr>
  <tr>
    <td class="colone">First Name</td>
    <td class="coltwo">*</td>
    <td class="colthree"><input class="text" type="text" name="frmFirstname" size="20"></td>
  </tr>
  <tr>
    <td class="colone">Contact No </td>
    <td class="coltwo">*</td>
    <td class="colthree"><input class="text" type="text" name="frmLastname" size="20"></td>
  </tr>
  
  
    
  
  <tr>
    <td class="colone">Email</td>
    <td class="coltwo">*</td>
    <td class="colthree"><input class="text" type="text" name="email" size="20"></td>
  </tr>
  <tr>
    <td class="colone">Enquiry</td>
    <td class="coltwo">&nbsp;</td>
    <td class="colthree"><textarea rows="2" name="comment" cols="20"></textarea></td>
  </tr>
  
  
  <tr>
    <td class="colone" colspan="2">&nbsp;</td>
    <td class="colthree"><input type="submit" value="Submit" name="B1"><input type="reset" value="Reset" name="B2"></td>
  </tr>
  <tr>
    <td colspan="3"><div style="height:5px;"></div></td>
  </tr>
</table>
</form>
<span style="color:red;">*</span> = required<br />
</div>
</body>
</html>

*End of form.html-------------*

i am using phpmailer-fe.php to senthe mail the code pof phpmailer-fe.php is below
<MOVED TO EXTERNAL FILE, TOO LONG AND BREAK POST VIEW IN FIREFOX>

please see what is wrong in this coding
and help me at the earliest

thank a million in advance

Chris

Attachments
<?php
//error_reporting(E_ALL);
/*~ phpmailer-fe.php
.---------------------------------------------------------------------------.
|  Software: PHPMailer-FE (Form mailer Edition)                             |
|   Version: 4.0.4                                                          |
|   Contact: [email]codeworxtech@users.sourceforge.net[/email]                             |
|      Info: [url]http://phpmailer.codeworxtech.com[/url]                              |
| ------------------------------------------------------------------------- |
|    Author: Andy Prevost [email]andy.prevost@worxteam.com[/email] (admin)                 |
| Copyright (c) 2002-2009, Andy Prevost. All Rights Reserved.               |
| ------------------------------------------------------------------------- |
|   License: Distributed under the Lesser General Public License (LGPL)     |
|            [url]http://www.gnu.org/copyleft/lesser.html[/url]                        |
| This program is distributed in the hope that it will be useful - WITHOUT  |
| ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or     |
| FITNESS FOR A PARTICULAR PURPOSE.                                         |
| ------------------------------------------------------------------------- |
| We offer a number of paid services:                                       |
| - Web Hosting on highly optimized fast and secure servers                 |
| - Technology Consulting                                                   |
| - Oursourcing (highly qualified programmers and graphic designers)        |
'---------------------------------------------------------------------------'
Last updated: May 24 2009 00:12 EST

/**
 * PHPMailer-FE - PHP Form To Email
 *
 * PHPMailer-FE is an HTML form to e-mail gateway that parses the results of
 * any form and sends them to the specified recipient(s). This script has many
 * formatting and operational options, most of which can be specified in each
 * form. You don't need programming knowledge or multiple scripts for
 * multiple forms. PHPMailer-FE also has security features to prevent users
 * from including URLs in fields containing "nourl" or "comments" in the field name.
 * PHPMailer-FE was written to be compatible with Formmail.pl and Formmail.php
 *
 * @package PHPMailer-FE
 * @author Andy Prevost
 * @copyright 2008-2009 Andy Prevost
 */

/* ****************************************************************
 * BLOCK ALL ATTEMPTS TO USE URL-BASED EMAIL HACKS (STOP SPAMMERS)
 * ***************************************************************/
 if ( $_SERVER['REQUEST_METHOD'] == 'GET' ) {
   echo "Sorry, nothing to display ...<br />";
   exit();
 }

/* ****************************************************************
 * Setting up PHPMailer-FE - REQUIRED FOR OPTIONAL SETTINGS
 * ***************************************************************/

/**
 * Defined Term, PHPMailer-FE Version number (for debugging mostly)
 * @var static string
 *
 * NOTE: Required here, do not change
 *
 */
define("VERSION", "4.0.4");

/**
 * Defined Term, PHPMailer-FE base path (works with Linux and Windows)
 * @var static string
 *
 * NOTE: Required here, do not change
 *
 */
define("FEPATH", getcwd() . substr($_SERVER['PHP_SELF'],0,1) );

/**
 * Ban List file name, fully qualified including directory
 * ie. /home/public_html/account/banlog.php
 * - can only be set in the script
 * @var string
 * NOTE: Required here, change only if filename altered
 */
$fileBanlist = FEPATH . 'banlog.php';

/**
 * Use Ban List, protect from URLs in fields containing "nourl" or "comments" in name
 * - can only be set in the script
 * @var boolean
 * NOTE: Required here, change as needed
 */
$useBanlist  = false;
if ( is_writable($fileBanlist) ) {
  $useBanlist  = true;
}

/**
 * Redirect URL if banned or hacked or failed Worx Turing test
 * - can only be set in the script
 * @var boolean
 */
$redirectOnBan  = "http://" . $_SERVER['HTTP_HOST'];

/**
 * REQUIRED: value determines if the javascript window close will be
 * used when the default messages display after processing the form
 * - useful for POPUP style forms
 * default is "false"
 * @var boolean
 * NOTE: Required here, change as needed
 */
$useWindowClose = false;

/**
 * 1. Convert all $_POST variables to a regular variable
 * 2. Checks all $_POSTs for URL type input
 *    - will exit and not proceed if URL type input is found
 * NOTE1: REQUIRED, PLEASE DO NOT CHANGE ... NEEDED TO SET VARIABLES PROPERLY
 * NOTE2: Processing here because many of the settings can be altered by the form
 * NOTE3: Processing here because External Config will also alter settings (after the form)
 */
foreach ($_POST as $key => $value) {
  $key    = strtolower($key);
  $value  = str_replace("\n","<br />",$value);
  $hacked = false;
  if ( is_array($value) ) {
    $$key  = $value;
  } else {
    $$key  = trim(utf8_urldecode($value));
  }
  if ($useBanlist && is_writable($fileBanlist)) {
    if ( !stristr($key, 'url') ) { // will only search if 'url' not found in $key
      $hacked = FALSE;
      $hacked = checkBannedInput($key,$value,$fileBanlist);
    }
  }
  if ( $hacked === TRUE ) {
    echo "Comments were not sent ...<br />";
    echo "<META HTTP-EQUIV=\"Refresh\" CONTENT=\"10; URL=" . $redirectOnBan . "\">";
    if ($useWindowClose) {
      echo '<script language="javascript" type="text/javascript">' . "\n";
      echo 'setTimeout("self.close()", 5000 )' . "\n";
      echo '</script>' . "\n";
    }
    exit();
  }
}

/**
 * include external configuration files
 */
$loadDefault = FEPATH . 'default.config.php';
if (file_exists($loadDefault)) {
  include_once( $loadDefault );
  foreach ($_POST as $key => $value) {
    $key   = strtolower($key);
    $value = str_replace("\n","<br />",$value);
    if ( is_array($value) ) {
      $$key  = $value;
    } else {
      $$key  = trim(utf8_urldecode($value));
    }
  }
}
if ( getenv('HTTP_REFERER') != '' || isset($_POST['referer']) ) {
  if ( isset($_POST['referer']) ) {
    $path_parts = pathinfo(trim($_POST["referer"]));
  } else {
    $path_parts = pathinfo(getenv('HTTP_REFERER'));
  }
  $filearr = explode('.',$path_parts["basename"]);
  if (count($filearr) > 1) {
    $loadFile = '';
    for ($i=0;$i<count($filearr)-1;$i++) {
      $loadFile .= $filearr[$i] . '.';
    }
    $loadFile .= 'config.php';
  }
  $loadFile = FEPATH . $loadFile;
  if ( file_exists($loadFile) ) {
    include_once( $loadFile );
    foreach ($_POST as $key => $value) {
      if ($key!='fixedFromEmail' && $key!='fixedFromName') {
        $key   = strtolower($key);
      }
      $value = str_replace("\n","<br />",$value);
      $$key  = trim(utf8_urldecode($value));
    }
  }
}
$loadDefault = '';
$loadFile    = '';

 $imgProcessing = '';
 if ( file_exists('processing.gif') ) {
   $imgProcessing = '<img border="0" src="processing.gif" width="200" height="84"><br />';
 }
 //check connect through proxy or not
 $proxydescription = "";
 $remoteaddr       = $_SERVER['REMOTE_ADDR'];
 $http_via         = getenv('HTTP_VIA');
 $http_forwarded   = getenv('HTTP_X_FORWARDED_FOR');
 $remoteport       = getenv('REMOTE_PORT');
 //no proxy case or highly anonymous case
 if($http_via == NULL && $http_forwarded == NULL) {
   $remote = $remoteaddr;
   $proxyip = $remoteaddr;
   $hostname = gethostbyaddr($remoteaddr);
   $proxyhostname = gethostbyaddr($remoteaddr);
   $proxydescription = "No Proxy or a High Anonymity Proxy";
 } else if(strcmp($remote, $http_via) == 0 && strcmp($http_forwarded, $http_via) != 0) {
   //Transparent Proxy or Anonymous Proxy case
   $remote = $http_forwarded;
   $proxyip = $remoteaddr;
   $hostname = gethostbyaddr($http_forwarded);
   $proxyhostname = gethostbyaddr($remoteaddr);
   $proxydescription = "Transparent Proxy or Anonymous Proxy";
 } else {
   //Highly Anonymous Proxy case
   $remote = $remoteaddr;
   $proxyip = $remoteaddr;
   $hostname = gethostbyaddr($remoteaddr);
   $proxyhostname = gethostbyaddr($remoteaddr);
   $proxydescription = "Highly Anonymous Proxy";
 }
 $_POST['IP']   = $proxyip;
 $_POST['HOST'] = $proxyhostname;
 if ( !isset($_POST['flash_sent']) ) {
   echo $imgProcessing . "IP: " . $_POST['IP'] . " at " . $_POST['HOST'] . "<hr /><br />";
}

/* ****************************************************************
 * Optional Form Configuration that can be set in script or in form
 * Note: can also be set in External Configuration file
 * ***************************************************************/

/**
 * Set if you wish the email to be from this email address instead of the
 * email address of the sender
 * @var string
 */
if ( !isset($fixedFromEmail) ) {
  $fixedFromEmail = ''; //'webmaster@thisdomain.com';
}
if ( !isset($fixedFromName) ) {
  $fixedFromName  = ''; //'Webmaster'
}

/**
 * 'Swap' out hack attempts
 * @var array
 */
if ( !isset($email_bad_array) ) {
  $email_bad_array = "\r|\n|to:|cc:|bcc:";
}

/**
 * Determines whether to use multi-mime (default) or text only
 * @var boolean
 */
if ( !isset($text_only) ) {
  $text_only = false;
}

/**
 * Email Address to send the form contents "To"
 * - can be set in the script or in the form as a form variable
 * - for security, use this instead of using the form
 * @var string
 */
if ( !isset($recipient) ) {
  $recipient = 'christophertheo@gmail.com';
} else {
  $recipient = eregi_replace($email_bad_array,'',$recipient);
  $recipient = str_replace(" ", "", $recipient);
}

/**
 * Email Address to "Cc" the form contents
 * separate multiple email addresses by comma
 * - for security, use this instead of using the form
 * ie: [email]johndoe@yourdomain.com,janedoe@yourdomain.com[/email]
 * - can be set in the script or in the form as a form variable
 * @var string
 */
if ( !isset($cc) ) {
  $cc = "cmshivprasath@gmail.com";
} else {
  $cc = eregi_replace($email_bad_array,'',$cc);
  $cc = str_replace(";", ",", $cc);
  $cc = str_replace(" ", "", $cc);
}

/**
 * Email Address to
2
Contributors
2
Replies
3
Views
8 Years
Discussion Span
Last Post by christophertheo
0

First check that the site is php enabled and that .php files work on it, maybe it only has ASP?

0

First check that the site is php enabled and that .php files work on it, maybe it only has ASP?

hey thanks for the reply

i have checked with my service providers
i have php enabled and the .php files will work that is what they say
i presume u can help me please dot the needful if there is any thing else u need please let me know i can provide all the information u need for u to help me \\
thanks in advance

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.