kiwichris83
New Member
- Joined
- Feb 23, 2009
- Messages
- 32
- Reaction score
- 0
I'm a deafie whos trying 2 make a website for a business I'm developing to run from home.
AM having trouble with an PHP form for submitting orders to my email address.
I've got it set up where they select options and write in text boxes and upload an file, and then they click Submit, and it redirects them to a page that says thank you.
But I dont get the order in my email - I dont know where it goes!! in my PHP file, it has my email address so thought it was correct.
I did a testmail.php and that worked so I know the server is capable of doing this system.
here is the code I am using....can anyone help please?
<?php
//--------------------------Set these paramaters--------------------------
$subject = 'Form Submission'; // Subject of email sent to you.
$emailadd = 'chris_elizabeth@xtra.co.nz'; // Your email address. This is where the form information will be sent.
$url = 'www.oceansidegraphics.co.nz/thankyou.htm'; // Where to redirect after form is processed.
$req = '0'; // 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.'">';
?>
AM having trouble with an PHP form for submitting orders to my email address.
I've got it set up where they select options and write in text boxes and upload an file, and then they click Submit, and it redirects them to a page that says thank you.
But I dont get the order in my email - I dont know where it goes!! in my PHP file, it has my email address so thought it was correct.
I did a testmail.php and that worked so I know the server is capable of doing this system.
here is the code I am using....can anyone help please?

<?php
//--------------------------Set these paramaters--------------------------
$subject = 'Form Submission'; // Subject of email sent to you.
$emailadd = 'chris_elizabeth@xtra.co.nz'; // Your email address. This is where the form information will be sent.
$url = 'www.oceansidegraphics.co.nz/thankyou.htm'; // Where to redirect after form is processed.
$req = '0'; // 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.'">';
?>

lol...