Skip navigation
Tahoe Systems
Currently Being Moderated

PHP Form mailer script problem.. Please help!

Aug 28, 2012 10:12 AM

Hello everyone!

 

Thank you in advance for taking a look at this post for me.

 

--------------->   I am fairly new, designing my second website ever... I have stepped up to a bit more 'complex' form in my second website, that is designed to "request a quote" for a commercial appraisal. I have set up the  form and it seems to work just fine. But my problem is getting the php script to work with the form redirecting the user to the thankyou.html page on my site. Also, I am actually recieving the email with all the correct information, but the script just won't redirect the user to the thankyou page.

 

This is the error I get after hitting the submit button in a browser:

 

 

THE ERROR

 

 

Warning: file_get_contents(blockip.txt) [function.file-get-contents]: failed to open stream: No such file or directory in /home/content/85/9643885/html/root_je/php/form2mail.php on line 50


Deprecated: Function ereg_replace() is deprecated in /home/content/85/9643885/html/root_je/php/form2mail.php on line 111


Warning: Cannot modify header information - headers already sent by (output started at /home/content/85/9643885/html/root_je/php/form2mail.php:50) in /home/content/85/9643885/html/root_je/php/form2mail.php on line 136

 

 

 

THE PHP SCRIPT

 

-------------->   I am using a free script from the web that I found, I have tried several, but this one has shown the best results so far: It's called form2mail.php and the script reads:***********

 

 

 

 

<?php

# You can use this script to submit your forms or to receive orders by email.

$MailToAddress = "jim@jeurmston.com"; // your email address

$redirectURL = "http://www.jeurmston.com/thankyou.html"; // the URL of the thank you page.

$MailSubject = "[Website form message]"; // the subject of the email

$sendHTML = FALSE; //set to "false" to receive Plain TEXT e-mail

$serverCheck = TRUE; // if, for some reason you can't send e-mails, set this to "false"

 

 

# copyright 2006 Web4Future.com =================== READ THIS ===================================================

 

 

# If you are asking for a name and an email address in your form, you can name the input fields "name" and "email".

# If you do this, the message will apear to come from that email address and you can simply click the reply button to answer it.

 

 

# To block an IP, simply add it to the blockip.txt text file.

# CHMOD 777 the blockip.txt file (run "CHMOD 777 blockip.txt", without the double quotes)

# This is needed because the script tries to block the IP that tried to hack it

 

 

# If you have a multiple selection box or multiple checkboxes, you MUST name the multiple list box or checkbox as "name[]" instead of just "name"

# you must also add "multiple" at the end of the tag like this: <select name="myselectname[]" multiple>

# you have to do the same with checkboxes

 

 

/*****************************************************************

 

 

          Web4Future Easiest Form2Mail (GPL).

          Copyright (C) 1998-2006 Web4Future.com All Rights Reserved.

          http://www.Web4Future.com/

          This script was written by George L. & Calin S. from Web4Future.com

 

 

          This program is free software; you can redistribute it and/or modify

          it under the terms of the GNU General Public License as published by

          the Free Software Foundation; either version 2 of the License, or

          (at your option) any later version.

 

 

          This program is distributed in the hope that it will be useful,

          but WITHOUT ANY WARRANTY; without even the implied warranty of

          MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the

          GNU General Public License for more details.

 

 

*****************************************************************/

 

 

# DO NOT EDIT BELOW THIS LINE UNLESS YOU KNOW WHAT YOU ARE DOING ===================================================

$w4fver =  "2.2";

$ip = ($_SERVER['HTTP_X_FORWARDED_FOR'] == "" ? $_SERVER['REMOTE_ADDR'] : $_SERVER['HTTP_X_FORWARDED_FOR']);

//function blockIP

function blockip($ip) {

          $handle = @fopen("blockip.txt", 'a');

          @fwrite($handle, $ip."\n");

          @fclose($handle);

}

$w4fx = stristr(file_get_contents('blockip.txt'),getenv('REMOTE_ADDR'));

if ($serverCheck) {

          if (preg_match ("/".str_replace("www.", "", $_SERVER["SERVER_NAME"])."/i", $_SERVER["HTTP_REFERER"])) { $w4fy = TRUE; } else { $w4fy = FALSE; }

} else { $w4fy = TRUE; }

if (($w4fy === TRUE) && ($w4fx === FALSE)) {

$w4fMessage = "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\"><html>\n<head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\"></head><body><font face=3Dverdana size=3D2>";

if (count($_GET) >0) {

          reset($_GET);

          while(list($key, $val) = each($_GET)) {

                    $GLOBALS[$key] = $val;

                    if (is_array($val)) {

                              $w4fMessage .= "<b>$key:</b> ";

                              foreach ($val as $vala) {

                                        $vala =stripslashes($vala);

                                        $vala = htmlspecialchars($vala);

                                        if (trim($vala)) { if (stristr($vala,"Content-Type:") || stristr($vala,"MIME-Version") || stristr($vala,"Content-Transfer-Encoding") || stristr($vala,"bcc:")) { blockip($ip); die("ILLEGAL EXECUTION DETECTED!"); }          }

                                        $w4fMessage .= "$vala, ";

                              }

                              $w4fMessage .= "<br>\n";

                    }

                    else {

                              $val = stripslashes($val);

                              if (trim($val)) { if (stristr($val,"Content-Type:") || stristr($val,"MIME-Version") || stristr($val,"Content-Transfer-Encoding") || stristr($val,"bcc:")) { blockip($ip); die("ILLEGAL EXECUTION DETECTED!"); }          }

                              if (($key == "Submit") || ($key == "submit")) { }

                              else {           if ($val == "") { $w4fMessage .= "$key: - <br>\n"; }

                                                  else { $w4fMessage .= "<b>$key:</b> $val<br>\n"; }

                              }

                    }

          } // end while

}//end if

else {

          reset($_POST);

          while(list($key, $val) = each($_POST)) {

                    $GLOBALS[$key] = $val;

                    if (is_array($val)) {

                              $w4fMessage .= "<b>$key:</b> ";

                              foreach ($val as $vala) {

                                        $vala =stripslashes($vala);

                                        $vala = htmlspecialchars($vala);

                                        if (trim($vala)) { if (stristr($vala,"Content-Type:") || stristr($vala,"MIME-Version") || stristr($vala,"Content-Transfer-Encoding") || stristr($vala,"bcc:")) {blockip($ip); die("ILLEGAL EXECUTION DETECTED!"); }          }

                                        $w4fMessage .= "$vala, ";

                              }

                              $w4fMessage .= "<br>\n";

                    }

                    else {

                              $val = stripslashes($val);

                              if (trim($val)) { if (stristr($val,"Content-Type:") || stristr($val,"MIME-Version") || stristr($val,"Content-Transfer-Encoding") || stristr($val,"bcc:")) {blockip($ip); die("ILLEGAL EXECUTION DETECTED!"); }          }

                              if (($key == "Submit") || ($key == "submit")) { }

                              else {           if ($val == "") { $w4fMessage .= "$key: - <br>\n"; }

                                                  else { $w4fMessage .= "<b>$key:</b> $val<br>\n"; }

                              }

                    }

          } // end while

          }//end else

          $w4fMessage .= "<font size=3D1><br><br>\n Sender IP: ".$ip."</font></font></body></html>";

    $w4f_what = array("/To:/i", "/Cc:/i", "/Bcc:/i","/Content-Type:/i","/\n/");

          $name = preg_replace($w4f_what, "", $name);

          $email = preg_replace($w4f_what, "", $email);

if (!$email) {$email = $MailToAddress;}

          $mailHeader = "From: $name <$email>\r\n";

          $mailHeader .= "Reply-To: $name <$email>\r\n";

          $mailHeader .= "Message-ID: <". md5(rand()."".time()) ."@". ereg_replace("www.","",$_SERVER["SERVER_NAME"]) .">\r\n";

          $mailHeader .= "MIME-Version: 1.0\r\n";

          if ($sendHTML) {

                    $mailHeader .= "Content-Type: multipart/alternative;";

                    $mailHeader .= "           boundary=\"----=_NextPart_000_000E_01C5256B.0AEFE730\"\r\n";

          }

          $mailHeader .= "X-Priority: 3\r\n";

          $mailHeader .= "X-Mailer: PHP/" . phpversion()."\r\n";

          $mailHeader .= "X-MimeOLE: Produced By Web4Future Easiest Form2Mail $w4fver\r\n";

          if ($sendHTML) {

                    $mailMessage = "This is a multi-part message in MIME format.\r\n\r\n";

                    $mailMessage .= "------=_NextPart_000_000E_01C5256B.0AEFE730\r\n";

                    $mailMessage .= "Content-Type: text/plain;   charset=\"ISO-8859-1\"\r\nContent-Transfer-Encoding: quoted-printable\r\n\r\n";

                    $mailMessage .= trim(strip_tags($w4fMessage))."\r\n\r\n";

                    $mailMessage .= "------=_NextPart_000_000E_01C5256B.0AEFE730\r\n";

                    $mailMessage .= "Content-Type: text/html;   charset=\"ISO-8859-1\"\r\nContent-Transfer-Encoding: quoted-printable\r\n\r\n";

                    $mailMessage .= "$w4fMessage\r\n\r\n";

                    $mailMessage .= "------=_NextPart_000_000E_01C5256B.0AEFE730--\r\n";

          }

          if ($sendHTML === FALSE) {

                    $mailHeader .= "Content-Type: text/plain;   charset=\"ISO-8859-1\"\r\nContent-Transfer-Encoding: quoted-printable\r\n\r\n";

                    $mailMessage .= trim(strip_tags($w4fMessage))."\r\n\r\n";

          }

 

 

          if (!mail($MailToAddress, $MailSubject, $mailMessage,$mailHeader)) { echo "Error sending e-mail!";}

          else { header("Location: ".$redirectURL); }

} else { echo "<center><font face=verdana size=3 color=red><b>ILLEGAL EXECUTION DETECTED!</b></font></center>";}

?>

 

   

<?php

# You can use this script to submit your forms or to receive orders by email.

$MailToAddress = "jim@jeurmston.com"; // your email address

$redirectURL = "http://www.jeurmston.com/thankyou.html"; // the URL of the thank you page.

$MailSubject = "[Website form message]"; // the subject of the email

$sendHTML = FALSE; //set to "false" to receive Plain TEXT e-mail

$serverCheck = TRUE; // if, for some reason you can't send e-mails, set this to "false"

 

 

# copyright 2006 Web4Future.com =================== READ THIS ===================================================

 

 

# If you are asking for a name and an email address in your form, you can name the input fields "name" and "email".

# If you do this, the message will apear to come from that email address and you can simply click the reply button to answer it.

 

 

# To block an IP, simply add it to the blockip.txt text file.

# CHMOD 777 the blockip.txt file (run "CHMOD 777 blockip.txt", without the double quotes)

# This is needed because the script tries to block the IP that tried to hack it

 

 

# If you have a multiple selection box or multiple checkboxes, you MUST name the multiple list box or checkbox as "name[]" instead of just "name"

# you must also add "multiple" at the end of the tag like this: <select name="myselectname[]" multiple>

# you have to do the same with checkboxes

 

 

          Web4Future Easiest Form2Mail (GPL).

          Copyright (C) 1998-2006 Web4Future.com All Rights Reserved.

          http://www.Web4Future.com/

          This script was written by George L. & Calin S. from Web4Future.com

 

 

          This program is free software; you can redistribute it and/or modify

          it under the terms of the GNU General Public License as published by

          the Free Software Foundation; either version 2 of the License, or

          (at your option) any later version.

 

 

          This program is distributed in the hope that it will be useful,

          but WITHOUT ANY WARRANTY; without even the implied warranty of

          MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the

          GNU General Public License for more details.

 

 

 

# DO NOT EDIT BELOW THIS LINE UNLESS YOU KNOW WHAT YOU ARE DOING ===================================================

$w4fver =  "2.2";

$ip = ($_SERVER['HTTP_X_FORWARDED_FOR'] == "" ? $_SERVER['REMOTE_ADDR'] : $_SERVER['HTTP_X_FORWARDED_FOR']);

//function blockIP

function blockip($ip) {

          $handle = @fopen("blockip.txt", 'a');

          @fwrite($handle, $ip."\n");

          @fclose($handle);

}

$w4fx = stristr(file_get_contents('blockip.txt'),getenv('REMOTE_ADDR'));

if ($serverCheck) {

          if (preg_match ("/".str_replace("www.", "", $_SERVER["SERVER_NAME"])."/i", $_SERVER["HTTP_REFERER"])) { $w4fy = TRUE; } else { $w4fy = FALSE; }

} else { $w4fy = TRUE; }

if (($w4fy === TRUE) && ($w4fx === FALSE)) {

$w4fMessage = "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\"><html>\n<head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\"></head><body><font face=3Dverdana size=3D2>";

if (count($_GET) >0) {

          reset($_GET);

          while(list($key, $val) = each($_GET)) {

                    $GLOBALS[$key] = $val;

                    if (is_array($val)) {

                              $w4fMessage .= "<b>$key:</b> ";

                              foreach ($val as $vala) {

                                        $vala =stripslashes($vala);

                                        $vala = htmlspecialchars($vala);

                                        if (trim($vala)) { if (stristr($vala,"Content-Type:") || stristr($vala,"MIME-Version") || stristr($vala,"Content-Transfer-Encoding") || stristr($vala,"bcc:")) { blockip($ip); die("ILLEGAL EXECUTION DETECTED!"); }          }

                                        $w4fMessage .= "$vala, ";

                              }

                              $w4fMessage .= "<br>\n";

                    }

                    else {

                              $val = stripslashes($val);

                              if (trim($val)) { if (stristr($val,"Content-Type:") || stristr($val,"MIME-Version") || stristr($val,"Content-Transfer-Encoding") || stristr($val,"bcc:")) { blockip($ip); die("ILLEGAL EXECUTION DETECTED!"); }          }

                              if (($key == "Submit") || ($key == "submit")) { }

                              else {           if ($val == "") { $w4fMessage .= "$key: - <br>\n"; }

                                                  else { $w4fMessage .= "<b>$key:</b> $val<br>\n"; }

                              }

                    }

          } // end while

}//end if

else {

          reset($_POST);

          while(list($key, $val) = each($_POST)) {

                    $GLOBALS[$key] = $val;

                    if (is_array($val)) {

                              $w4fMessage .= "<b>$key:</b> ";

                              foreach ($val as $vala) {

                                        $vala =stripslashes($vala);

                                        $vala = htmlspecialchars($vala);

                                        if (trim($vala)) { if (stristr($vala,"Content-Type:") || stristr($vala,"MIME-Version") || stristr($vala,"Content-Transfer-Encoding") || stristr($vala,"bcc:")) {blockip($ip); die("ILLEGAL EXECUTION DETECTED!"); }          }

                                        $w4fMessage .= "$vala, ";

                              }

                              $w4fMessage .= "<br>\n";

                    }

                    else {

                              $val = stripslashes($val);

                              if (trim($val)) { if (stristr($val,"Content-Type:") || stristr($val,"MIME-Version") || stristr($val,"Content-Transfer-Encoding") || stristr($val,"bcc:")) {blockip($ip); die("ILLEGAL EXECUTION DETECTED!"); }          }

                              if (($key == "Submit") || ($key == "submit")) { }

                              else {           if ($val == "") { $w4fMessage .= "$key: - <br>\n"; }

                                                  else { $w4fMessage .= "<b>$key:</b> $val<br>\n"; }

                              }

                    }

          } // end while

          }//end else

          $w4fMessage .= "<font size=3D1><br><br>\n Sender IP: ".$ip."</font></font></body></html>";

    $w4f_what = array("/To:/i", "/Cc:/i", "/Bcc:/i","/Content-Type:/i","/\n/");

          $name = preg_replace($w4f_what, "", $name);

          $email = preg_replace($w4f_what, "", $email);

if (!$email) {$email = $MailToAddress;}

          $mailHeader = "From: $name <$email>\r\n";

          $mailHeader .= "Reply-To: $name <$email>\r\n";

          $mailHeader .= "Message-ID: <". md5(rand()."".time()) ."@". ereg_replace("www.","",$_SERVER["SERVER_NAME"]) .">\r\n";

          $mailHeader .= "MIME-Version: 1.0\r\n";

          if ($sendHTML) {

                    $mailHeader .= "Content-Type: multipart/alternative;";

                    $mailHeader .= "           boundary=\"----=_NextPart_000_000E_01C5256B.0AEFE730\"\r\n";

          }

          $mailHeader .= "X-Priority: 3\r\n";

          $mailHeader .= "X-Mailer: PHP/" . phpversion()."\r\n";

          $mailHeader .= "X-MimeOLE: Produced By Web4Future Easiest Form2Mail $w4fver\r\n";

          if ($sendHTML) {

                    $mailMessage = "This is a multi-part message in MIME format.\r\n\r\n";

                    $mailMessage .= "------=_NextPart_000_000E_01C5256B.0AEFE730\r\n";

                    $mailMessage .= "Content-Type: text/plain;   charset=\"ISO-8859-1\"\r\nContent-Transfer-Encoding: quoted-printable\r\n\r\n";

                    $mailMessage .= trim(strip_tags($w4fMessage))."\r\n\r\n";

                    $mailMessage .= "------=_NextPart_000_000E_01C5256B.0AEFE730\r\n";

                    $mailMessage .= "Content-Type: text/html;   charset=\"ISO-8859-1\"\r\nContent-Transfer-Encoding: quoted-printable\r\n\r\n";

                    $mailMessage .= "$w4fMessage\r\n\r\n";

                    $mailMessage .= "------=_NextPart_000_000E_01C5256B.0AEFE730--\r\n";

          }

          if ($sendHTML === FALSE) {

                    $mailHeader .= "Content-Type: text/plain;   charset=\"ISO-8859-1\"\r\nContent-Transfer-Encoding: quoted-printable\r\n\r\n";

                    $mailMessage .= trim(strip_tags($w4fMessage))."\r\n\r\n";

          }

 

 

          if (!mail($MailToAddress, $MailSubject, $mailMessage,$mailHeader)) { echo "Error sending e-mail!";}

          else { header("Location: ".$redirectURL); }

} else { echo "<center><font face=verdana size=3 color=red><b>ILLEGAL EXECUTION DETECTED!</b></font></center>";}

?>

 

 

 

 

THE HTML FORM

 

------------------> And finally here is my html FORM page request_quote.html:*************************

 

 

 

 

 

<!DOCTYPE HTML><html><!-- InstanceBegin template="/Templates/je_fullwidth.dwt" codeOutsideHTMLIsLocked="false" -->

 

 

<head>

          <script type="text/javascript" src="js/jquery.js"></script>

 

    <link href="css/styles.css" rel="stylesheet" type="text/css" media="screen">

 

 

    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

          <meta http-equiv="Content-Type" content="cache" />

          <meta name="robots" content="INDEX,FOLLOW" />

          <meta name="keywords" content="Enter Keywords" />

          <meta name="description" content="Description Here" />

<!-- InstanceBeginEditable name="doctitle" -->

          <title>J.E. Urmston Request A Quote Page</title>

   

                              <script>(function(H){H.className=H.className.replace(/ \bno-js\b/,'js')})(document.documentElement)</script>

                      <link href="css/validate.css" type="text/css" rel="stylesheet" media="screen,projection" />

           

                      <script type="text/javascript" src="js/validate.js"></script>

           

                               <script type="text/javascript">

                $(document).ready(function() {

                    $('form.required-form').simpleValidate({

                        errorElement: 'em'

                    });

                });

            </script>

   

          <!-- InstanceEndEditable -->

          <!-- Google Analytics Code Goes Below Here -->

       

   

    <!-- End Google Analytics Code -->

<!-- InstanceBeginEditable name="head" -->

<!-- InstanceEndEditable -->

</head>

 

 

<body>

 

 

<div id="outer">

 

 

<div id="wrapper">

 

                    <div id="logo">

                              <img src="images/logos/logo_1.jpg" />

                    </div>

 

                    <div id="social-media-icons">

                  <ul>

                      <li><a href="http://www.facebook.com" target="_blank"><img src="images/icons/facebook_32.jpg" alt="Facebook Link" /></a></li>

              <li><a href="http://www.twitter.com" target="_blank"><img src="images/icons/twitter_32.jpg" alt="Twitter Link" /></a></li>

              <li><a href="mailto:jeurmston@charter.net"><img src="images/icons/email_32.jpg" alt="Email Link" /></a></li>

            </ul>

 

                    </div>

 

 

                    <div id="topnav">

                              <ul>

                      <li><a href="index.html">HOME</a></li>

                <li><a href="about.html">ABOUT</a></li>

                <li><a href="services.html">SERVICES</a></li>

                <li><a href="gallery.html">GALLERY</a></li>

                <li><a href="contact.html">CONTACT US</a></li>

            </ul>     

 

                    </div>

 

                    <div id="banner">

                  <img src="images/banner/reno1.jpg" alt="Banner image of Reno, NV at night" />

 

                    </div>

 

        <div id="content-fullwidth"><!-- InstanceBeginEditable name="content" -->

                    <div id="form-wrapper">

                      <h1>Request a Quote</h1>

                      <p>Lorem pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.</p>

             

              <form class="required-form" action="php/form2mail.php" method="post">

               <input type="hidden" name="redirect" value="thankyou.html" />              

                <ol class="forms">

                   

                    <li>

                      <label for="name"> Name of Property:</label>

                      <input type="text" name="name" id="name" />

                    </li>

                   

                    <li>

                      <label for="company"> Name of Company/Owner:</label>

                      <input type="text" name="company" id="company" />

                    </li>

                  

                    <li>

                      <label for="address1"><em class="required">*</em> Address / APN #:</label>

                      <input type="text" name="address1" id="address1" class="required" />

                    </li>

                   

                    <li>

                      <label for="address2"> Address 2:</label>

                      <input type="text" name="company" id="company" />

                    </li>

 

 

                    <li>

                      <label for="city"><em class="required">*</em> City:</label>

                      <input type="text" name="city" id="city" class="required" />

                    </li>

                   

                    <li>

                      <label for="state"> State:</label>

                                <p class="state">Nevada</p>

                    </li>

 

 

 

 

                    <li>

                      <label for="property[]"><em class="required">*</em> Use of Property:</label>

                      <select name="property[]" multiple id="property[]" class="required">

                                <option value="select" selected>Please Select...

                        <option value="assembly">Assembly/Meeting Place

                        <option value="commer">Commercial General

                        <option value="health">Health Care

                        <option value="indust">Industrial

                        <option value="land">Land

                        <option value="lodgeHosp">Lodging & Hospitality

                        <option value="mixed">Mixed-Use

                        <option value="multiFam">Multi-Family

                        <option value="office">Office

                        <option value="retail">Retail

                        <option value="senior">Senior Housing

                        <option value="shopping">Shopping Center

                        <option value="special">Special Purpose

                        <option value="sportEnt">Sports & Entertainment

                       </select>

                    </li>

                   

                    <li>

                      <label for="report[]"><em class="required">*</em> Report Type:</label>

                                <select name="report[]" multiple id="report[]" class="required">

                                  <option value="select" selected>Please Select...

                            <option value="self">Self Contained

                            <option value="summary">Summary

                            <option value="restricted">Restricted

                            <option value="advise">Unknown (please advise)

                        </select>

                    </li>

                   

 

 

                    <li>

                      <label for="client_company"> Client Company:</label>

                      <input type="text" name="client_company" id="client_company" class="required" />

                    </li>

           

                    <li>

                      <label for="client_first"><em class="required">*</em> Client First Name:</label>

                      <input type="text" name="client_first" id="client_first" class="required" />

                    </li>

  

                    <li>

                      <label for="client_last"><em class="required">*</em> Client last Name:</label>

                      <input type="text" name="client_last" id="client_last" class="required" />

                    </li>

 

 

                    <li>

                      <label for="client_phone"><em class="required">*</em> Client Phone:</label>

                      <input type="text" name="client_phone" id="client_phone" class="required" />

                    </li>

 

 

                    <li>

                      <label for="client_email"><em class="required">*</em> Client Email:</label>

                      <input type="text" name="client_email" id="client_email" class="required" />

                    </li>

 

 

  

                    <li>

                      <label for="message"> Message:</label>

                      <textarea name="message" id="message" ></textarea>

                    </li>

 

 

                    <li class="buttons submit">

                      <button type="submit">Submit</button>

                       </li>

 

 

                    <li class="buttons reset">

                      <button type="reset">Reset Form</button>

                       </li>

 

 

                        

                </ol>

              </form>

              </div>

 

                    <!-- InstanceEndEditable --></div>

           

 

                    <div id="footer">

                      <p class="footer-text">Copyright 2012    |    All rights reserved   |    382Designs</p>

    </div>

       

  </div>

  

</div>

 

 

</body>

<!-- InstanceEnd --></html>

 

 

 

Thank you so much for your help!! I have been killing myself trying to figure this out on my own. I really appreciate all the help I can get!

 
Replies
  • Currently Being Moderated
    Aug 28, 2012 10:44 AM   in reply to Tahoe Systems

    The error means your form script is not compatible with the PHP version your server is running. PHP 5 no longer uses the ereg function so anything attached to it will not function correctly without rewriting the code of the script.

     

    If there is a way to go back to PHP 4.x on that server, it would likely function correctly. If not, you will either need to re-write all of the ereg functions (ther are plenty of references on Google for "ereg function deprecated") or get a PHP 5.x compatible form script.

     

    I suggest www.tectite.com, they have a very nice PHP5 compatible form mail script if you don't plan to write the php yourself.

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 29, 2012 5:45 AM   in reply to Tahoe Systems

    If you are using the Tectite.com form mail, you can troubleshoot the no_valid_recipient here:

     

    http://www.tectite.com/vbforums/faq.php?faq=formmail_faq#faq_formmail_ email

     

    Usually it's going to require another hidden field like this...

     

    <input type="hidden" name="mail_options" value="FromAddr=someotheraddress@yourdomain.com" />

     

    There is likely a server setting stopping you from sending mail to yourself as if it's from another domain.

     

    The redirect hidden field is called "good_url" (there is also a bad_url for if/when the form is not processed). You can find all of the hidden fields here: http://www.tectite.com/fmdoc/creating_forms.php

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 29, 2012 9:15 AM   in reply to Tahoe Systems

    The hidden field with the name "redirect" should be named "good_url"

     

    You need both the "recipients" hidden field and the "mail_options...FromAddr" hidden fields.

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 29, 2012 10:20 AM   in reply to Tahoe Systems

    Sure, that's in the documentation too, you add a hidden field called "subject" with the value set as whatever you want the subject to be.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points