I am using dreamweaver 8 and have setup a simple form with name, phone number, email, and comments. I would like to have the information on this form emailed to me.
I found a simple form script and saved it as config.php, but it does not email me the information. I have the action as config.php, method as post, enctype as multipart/form-data. It sends me to the confirmation page, but I do not get a email. Is there another way to get this to work or if you know a better script to use.
The site is under free consultation.
Any help would be great!
here is the script I am using
<?php
// Simple Form Script
// Copyright (C) 2005 Eric Zhang
// 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.
//
// Please send bugs/questions to erkzh@yahoo.com.
//--------------------------Set these paramaters--------------------------
$subject = 'Form Submission'; // Subject of email sent to you.
$emailadd = 'allen@langbert.com'; // Your email address. This is where the form information will be sent.
$url = 'confirmation.html'; // Where to redirect after form is processed.
$req = '1'; // Makes all fields required. If set to '1' no field can not be empty. If set to '0' any or all fields can be empty.
// --------------------------Do not edit below this line--------------------------
$text = "Results from form:\n\n";
$space = ' ';
$line = '
';
foreach ($_POST as $key => $value)
{
if ($req == '1')
{
if ($value == '')
{echo "$key is empty";die;}
}
$j = strlen($key);
if ($j >= 20)
{echo "Name of form element $key cannot be longer than 20 characters";die;}
$j = 20 - $j;
for ($i = 1; $i <= $j; $i++)
{$space .= ' ';}
$value = str_replace('\n', "$line", $value);
$conc = "{$key}:$space{$value}$line";
$text .= $conc;
$space = ' ';
}
mail($emailadd, $subject, $text, 'From: '.$emailadd.'');
echo '<META HTTP-EQUIV=Refresh CONTENT="0; URL='.$url.'">';
?>
I found a simple form script and saved it as config.php, but it does not email me the information. I have the action as config.php, method as post, enctype as multipart/form-data. It sends me to the confirmation page, but I do not get a email. Is there another way to get this to work or if you know a better script to use.
The site is under free consultation.
Any help would be great!
here is the script I am using
<?php
// Simple Form Script
// Copyright (C) 2005 Eric Zhang
// 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.
//
// Please send bugs/questions to erkzh@yahoo.com.
//--------------------------Set these paramaters--------------------------
$subject = 'Form Submission'; // Subject of email sent to you.
$emailadd = 'allen@langbert.com'; // Your email address. This is where the form information will be sent.
$url = 'confirmation.html'; // Where to redirect after form is processed.
$req = '1'; // Makes all fields required. If set to '1' no field can not be empty. If set to '0' any or all fields can be empty.
// --------------------------Do not edit below this line--------------------------
$text = "Results from form:\n\n";
$space = ' ';
$line = '
';
foreach ($_POST as $key => $value)
{
if ($req == '1')
{
if ($value == '')
{echo "$key is empty";die;}
}
$j = strlen($key);
if ($j >= 20)
{echo "Name of form element $key cannot be longer than 20 characters";die;}
$j = 20 - $j;
for ($i = 1; $i <= $j; $i++)
{$space .= ' ';}
$value = str_replace('\n', "$line", $value);
$conc = "{$key}:$space{$value}$line";
$text .= $conc;
$space = ' ';
}
mail($emailadd, $subject, $text, 'From: '.$emailadd.'');
echo '<META HTTP-EQUIV=Refresh CONTENT="0; URL='.$url.'">';
?>