php/sendmail help!

php/sendmail help!

am 09.02.2006 10:24:36 von jusa_98

------=_NextPart_65d_fc28_cf2d4bf8.476a4018_.MIX
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Hi, I have a form, form results are PUSHED to another page and processed=
Files below. (in plain-tet)
=20
Now this is what I want to do:
=20
1) Make all fields required input, but if easy to configure I want to =
have rules for each textarea. For instance an email address must contai=
n a '@' symbol. Must be at leat 5 character longs and must be in a form=
of an email address. So if I type you@me it would produce an error, hi=
ghlighting the error area or display a message at the top of the page. =
Postcode should contain 4 numbers and numbers only, etc. The only field=
that can be left blank will be the message area. How do I achieve this=
? (message regarding this below)
=20
2) I want to add to the form a UNIQUE ID generater. I will add a new =
hidden form field for this. I need a script called by PHP to generate i=
t. Would include both letters and numbers and be atleast 8 CHARS long.
=20
As for 1) I have tried some javascript but it failed, since I PUSH all=
field responses to another page. When i add it the submit button fails=
and does not push the results through. But it produces the error fine,=
but form is not PUSHED on. So it seems it's lost because of the javasc=
ript. So i took it out completely. I think there is a way in PHP to ca=
ll errors for forms? But anways, here are the files below. Please help=
, I am on a tight schedule here if anyone can assist me.
=20
file one looks like this: (form.php)
=20









Pre Order Form!


4" BORDER=3D"0">
=20









<=
/tr>
>


First Name: E=3D"25" MAXLENGTH=3D"20">

Last Name:
" MAXLENGTH=3D"25">

Company: ZE=3D"25" MAXLENGTH=3D"25">

Unit/House #:
"25" MAXLENGTH=3D"6">

Street Name:
25" MAXLENGTH=3D"25">

Suburb/Town:
" MAXLENGTH=3D"25">

Post Code/Zip:
"25" MAXLENGTH=3D"25">

Phone #:
LENGTH=3D"25">

Email Address:
ZE=3D"25" MAXLENGTH=3D"25">
Country:
Message:

=20



=20






=20
=20
--end--
=20
here is file 2: resultsubmit.php
=20









$to =3D 'email@domain.com';=20
$from =3D 'local@localhost';=20
=20
//Check if we have something POSTed by the form.=20
if (isset($HTTP_POST_VARS)){=20
//Start with an empty body for the mail message=20
$body =3D '';=20
//Iterate through all the POSTed variables, and add them to =
the message body.=20
while (list($key, $value) =3D each($HTTP_POST_VARS)){=20
$body .=3D $key . ' =3D ' . $value . "
";=20
}=20
//Build up some nice From/Reply Headers=20
$headers =3D "From: $from";=20
//Mail the message out.=20
//Requires setting php3.ini sendmail path as per instruction=
s=20
$success =3D mail($to, "Posted " . date("m/d/Y"), $body, $he=
aders);=20
//Always check return codes from functions.=20
if ($success){=20
echo "
Please wait... Your request is being pr=
ocessed...!
";=20
}=20
else{=20
echo "
Internal Error: Your input was unp=
rocessed.
Contact $from
";=20
}=20
}=20
?>=20




=20
--end--
=20
=20
FYI I have changed some email settings and configuration files for sec=
urity reasons. But as you can see results are pushed to the second file=
than emailed off, no need for a database or anything. So you should be=
able to test very easily.
=20
If anyone can help with suggestions or even do the code it would be mo=
stly appreciated, can pay since it's urgent.
=20
Thanks for your time!
=20
J



************************************************************ **********

IMPORTANT NOTICE

This communication is for the exclusive use of the intended recipient(s)
named above. If you receive this communication in error, you should
notify the sender by e-mail or by telephone (+44) 191 224 4461, delete
it and destroy any copies of it.

This communication may contain confidential information and material
protected by copyright, design right or other intellectual property
rights which are and shall remain the property of Piranha Studios
Limited. Any form of distribution, copying or other unauthorised use
of this communication or the information in it is strictly prohibited.
Piranha Studios Limited asserts its rights in this communication and
the information in it and reserves the right to take action against
anyone who misuses it or the information in it.

Piranha Studios Limited cannot accept any liability sustained as a
result of software viruses and would recommend that you carry out your
own virus checks before opening any attachment.

************************************************************ ************
<<<>>>
------=_NextPart_65d_fc28_cf2d4bf8.476a4018_.MIX
Content-Type: text/plain;
name="GWAVADAT.TXT"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment; filename="GWAVADAT.TXT"

AdmID:6A8A36263EAF13571ADE265906F0171E



************************************************************ **********

IMPORTANT NOTICE

This communication is for the exclusive use of the intended recipient(s)
named above. If you receive this communication in error, you should
notify the sender by e-mail or by telephone (+44) 191 224 4461, delete
it and destroy any copies of it.

This communication may contain confidential information and material
protected by copyright, design right or other intellectual property
rights which are and shall remain the property of Piranha Studios
Limited. Any form of distribution, copying or other unauthorised use
of this communication or the information in it is strictly prohibited.
Piranha Studios Limited asserts its rights in this communication and
the information in it and reserves the right to take action against
anyone who misuses it or the information in it.

Piranha Studios Limited cannot accept any liability sustained as a
result of software viruses and would recommend that you carry out your
own virus checks before opening any attachment.

************************************************************ ************
<<<>>>

------=_NextPart_65d_fc28_cf2d4bf8.476a4018_.MIX
Content-Type: text/plain; charset=us-ascii

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
------=_NextPart_65d_fc28_cf2d4bf8.476a4018_.MIX--