email and postgresql
am 16.05.2002 15:25:24 von angelo.rigo
I would like to ask if it is possible
to have a form to be sent to an emailadress
and store the fields of my form in a table database
at the same time . How do you do that?
=20
________________________________________
A busca mais veloz e precisa da internet. Acesse agora: http://www.zoom.com=
..br.
---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?
http://archives.postgresql.org
Re: email and postgresql
am 16.05.2002 15:53:35 von Eckhard Hoeffner
* angelo.rigo@globo.com [16 05 02 15:25]:
>I would like to ask if it is possible
>to have a form to be sent to an emailadress
>and store the fields of my form in a table database
>at the same time . How do you do that?
Well, just do one after the other:
// 1. Send the Mail with the mail-function
$sent =3D mail($email, $subject, $sende_text, $from);
// 2. Store the Mail, if it was sent
if(!$sent){echo "Error";}
else{
$query =3D "INSERT INTO korrespondenz (kontakt_id, ansprpart_id,=20
betreff, text, art, ihrz, unserz, user_id)
VALUES ('$kontakt_id', $ansprpart_id, '$subject',=20
'$body', 'e', '$iz', '$uz', '$user_id')";
// start DB-Connection
// execute the query
} =20
--=20
--//--\\--
Eckhard Hoeffner
e-hoeffner@fifoost.org
Tal 44=20
D-80331 München
---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?
http://www.postgresql.org/users-lounge/docs/faq.html