Thread: PHP Issues
View Single Post
Old 03-29-2009, 11:53 PM   #4 (permalink)
JClarke
Good times, good times.
 
JClarke's Avatar
 
Join Date: Nov 2006
Location: Packing bags for U.S.A
Posts: 20,237
Blog Entries: 5
Looks like the php coding isn't closed. The email setting in the parameters seems correct. But the system won't compile. Try and get notepad++ from internet and paste htese php in notepad++ and ensure the notepad++ is formatted in php coding, where it will be possiblity help you find the error.


PHP Code:
<?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.'">';
?>
__________________
JClarke is offline   Reply With Quote