Friday, January 8, 2010

Website coding help. (intermediate/advanced)?

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?Website coding help. (intermediate/advanced)?
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-%26gt;level %26lt;= $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. :)Website coding help. (intermediate/advanced)?
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.
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.
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.
i don;t know abt PHP as im a asp %26amp; asp.net developer try to send a mail on page postback whenever you try to insert a record in the query...
Get some professional help here-





http://tinyurl.com/o5e26

No comments:

Post a Comment