...

View Full Version : extract user info and mail() out admin



droomagon
10-16-2009, 11:29 AM
Basically the idea is simple, simply grab and match the user's list of orders, and mail it out to administrator. But i'm stuck and no idea what to do.

This is the situation i'm at.

I have 2 tables, first table contains user's information, second table contains user's orders, and by matching the first and second table was user's sessionID when he/she submitted.

I can match the tables and extract the data, and display it on the webpage, that's easy, but what i can't figure out is how to extract it, and then mail() it to the administrator...

Any thoughts?

karlosio
10-16-2009, 12:05 PM
Basically the idea is simple, simply grab and match the user's list of orders, and mail it out to administrator. But i'm stuck and no idea what to do.

This is the situation i'm at.

I have 2 tables, first table contains user's information, second table contains user's orders, and by matching the first and second table was user's sessionID when he/she submitted.

I can match the tables and extract the data, and display it on the webpage, that's easy, but what i can't figure out is how to extract it, and then mail() it to the administrator...

Any thoughts?

Can you provide an example of your code? If your extracting it from a database you could maybe try something along the lines of this.



<?php
// database stuff
$email = 'admin@mysite.com'; // admin email address
$subject = "Order Info";

// the message
$message = "Order Info<br />\n";
$message =. "This user has ordered the following items: ";
// $row outputting order information fields from database
$message =. $row['order1'].' - '.$row['order2'];

mail($email, $subject, $message);
?>

droomagon
10-21-2009, 04:10 AM
i don't have the working code yet, but i am trying to figure out how to do it... thus far i don't anything on paper...

basically what i want to do is, do a search of the database matching user's ID, and gets a list of things from the database, and then MAIL it out to the user and admin.

so far, i have no clue how to do it...

there's is one example i can think of, that will relate to my question.

you know how you go to a shopping site, when u order things, and products would go to the shopping cart?
and when customer press the SUBMIT to order, the list of orders would be MAILED out to the customer's email.

that's what i am trying to accomplish



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum