English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

I have a site under construction, it will have a mysql database containing stock quantities of a product for sale... how would I include the feature that when an item is bought and stock levels drop that a notification email is sent to the site owner informing of either no stock remaining or low stock levels or simply that an irem has sold?

Would this require php and if so what code should be used?

2006-09-07 08:23:58 · 6 answers · asked by Anonymous in Computers & Internet Programming & Design

6 answers

What you need is to look into a thing called PEAR. http://pear.php.net/

You can install a pear module called "Mail" and using that module you can send emails out properly using the correct email header types.

Somewhere in your php code, all you have to do is have something like:

if($stock->level <= $minimum_items)
{
/* Mail an email out */
}

The standard php mail function doesn't allow you to do file attachments or what not. The PEAR one does. :)

2006-09-07 08:29:49 · answer #1 · answered by lordfish 1 · 0 0

I guess you know php, and you will have the mysql server installed on the machine...

the mysql hooks in php are easy to use... it's just a simple query.

2006-09-07 08:27:05 · answer #2 · answered by jake cigar™ is retired 7 · 0 0

The mail function is usually installed by default - at least on the servers I've used

Just go to PHP.net, and read the mail function in the manual, it's simple enough.

2006-09-07 08:57:00 · answer #3 · answered by kirun 6 · 0 0

couldnt you jsut use a data base and turn it a webpage. that way you could set up a quiry that will alert the user when new stock is needed to be prdered and thats at gcse lever/a level.

2006-09-07 08:27:15 · answer #4 · answered by joanne 2 · 0 0

i don;t know abt PHP as im a asp & asp.net developer try to send a mail on page postback whenever you try to insert a record in the query...

2006-09-07 08:26:49 · answer #5 · answered by rahul s 2 · 1 1

Get some professional help here-

http://tinyurl.com/o5e26

2006-09-07 15:39:56 · answer #6 · answered by Anonymous · 0 0

fedest.com, questions and answers