Re: email and postgresql

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



* angelo.rigo@xxxxxxxxx <angelo.rigo@xxxxxxxxx> [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 = mail($email, $subject, $sende_text, $from);

// 2. Store the Mail, if it was sent
if(!$sent){echo "Error";}
else{
  $query = "INSERT INTO korrespondenz (kontakt_id, ansprpart_id, 
                       betreff, text, art, ihrz, unserz, user_id)
            VALUES ('$kontakt_id', $ansprpart_id, '$subject', 
	    '$body', 'e', '$iz', '$uz', '$user_id')";
  // start DB-Connection
  // execute the query
}	    



-- 
--//--\\--
Eckhard Hoeffner
e-hoeffner@xxxxxxxxxxx
Tal 44 
D-80331 München


[Index of Archives]     [Postgresql General]     [Postgresql Admin]     [PHP Users]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Databases]     [Yosemite Backpacking]     [Postgresql Jobs]

  Powered by Linux