473,397 Members | 1,950 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

Mailing database-input after storing in DB

I have a registration form using php to process it and store values in
MySQL. That works. But I also would like to get a mail with each
registration input into the database. Anyone with any tip on where to
add this code in the insert-script? At the very beginning, in the
middle, or at the end? And will this piece of code actually mail me
each input? I can't get it to work.

if (phpversion() "4.0.6") {
$HTTP_POST_VARS = &$_POST;
}
if (isset($HTTP_POST_VARS["tipsViaEpost"])) {
// make email info
$to =
"my************@something.com,my*************@some thingelse.com";
$subject = "New registration";
$from = "From: Registration DB\r\n";
$body = "Details stored in db:-\n\n";
while (list($key,$value) == each($HTTP_POST_VARS)) {
$body.= $key . " = " . $value . "\n";
}

// now send the mail
mail($to,$subject,$body,$from);

// then redirect to another page
header("Location: registrationSent.php");
}
Mar 10 '08 #1
1 1149
On Mar 10, 1:44 pm, Nosferatum <John.Ola...@gmail.comwrote:
I have a registration form using php to process it and store values in
MySQL. That works. But I also would like to get a mail with each
registration input into the database. Anyone with any tip on where to
add this code in the insert-script? At the very beginning, in the
middle, or at the end? And will this piece of code actually mail me
each input? I can't get it to work.

if (phpversion() "4.0.6") {
$HTTP_POST_VARS = &$_POST;}

if (isset($HTTP_POST_VARS["tipsViaEpost"])) {
// make email info
$to =
"my_first_em...@something.com,my_second_em...@some thingelse.com";
$subject = "New registration";
$from = "From: Registration DB\r\n";
$body = "Details stored in db:-\n\n";
while (list($key,$value) == each($HTTP_POST_VARS)) {
$body.= $key . " = " . $value . "\n";

}

// now send the mail
mail($to,$subject,$body,$from);

// then redirect to another page
header("Location: registrationSent.php");

}
Is your sendmail configured or set up? Try sending a test mail from
the command line.
SOme mailers wont let you put multiple addresses in the 'to'
parameter. You might also want to try sending the mail to each
recipient separately.
Mar 15 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Dariusz | last post by:
I have written a database which uses PHP to run through each ID in the database and then generate a persons name and address to include into the rest of the PHP to send an email out. But as...
6
by: IC | last post by:
Hi, I'm building a website and I want to include a mailing list. I just want a form where a user could enter their email address, so I could send them more information. I assume that the best...
3
by: * Tong * | last post by:
or I have to be in some mlist in order to post? thanks -- Tong (remove underscore(s) to reply) *niX Power Tools Project: http://xpt.sourceforge.net/ - All free contribution & collection
29
by: Mainlander | last post by:
An ISP I belong to uses Majordomo for their mailing list system. I'd like to encourage them to move to a system that uses a database, preferably psql which they already run on their server....
3
by: Grim Reaper | last post by:
I know this is probably an easy question, but I could not find/figure it out. Basically, I am printing mailing labels with a "Sorting/Grouping" section that groups the label types together....
2
by: (Pete Cresswell) | last post by:
For better or worse, I have chosen to implement mailing addresses in a particular application as a separate table. One Person ==> Many Addresses. It is a database for managing school reunions...
0
by: sameer | last post by:
Hi, Steve i been trying to use this component paypay control which is really easy and excellent but this is what i think is the limitation and i just can not be done with. My checkout page...
4
by: Andy M | last post by:
ALERT There is a person by the name of Mike Cox who's trying to turn this mailing list into a Big-8 newsgroup. Many of you know that this and most of the other postresql mailing lists are...
5
by: Josh | last post by:
I'm curious about the limits of my current method of sending out e- mail w/ php and possibly alternatives. Right now, I have a mysql DB of registered users. I have a PHP file accessed daily that...
4
by: Dr Al | last post by:
I have a project which requires the batch import of customer contact information, print mailing labels for those customers who have their date of first letter field in the database set to null, and...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.