Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Dec 2005
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    extract user info and mail() out admin

    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?

  • #2
    Regular Coder
    Join Date
    Dec 2006
    Location
    In the wilderness
    Posts
    106
    Thanks
    9
    Thanked 5 Times in 5 Posts
    Quote Originally Posted by droomagon View Post
    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 Code:
    <?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);
    ?>
    "The advantage of computers is that they do exactly what you tell them to do. The disadvantage of computers, on the other hand, is that they do exactly what you tell them to do."

    Excellent resource for learning PHP here

  • #3
    New to the CF scene
    Join Date
    Dec 2005
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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
    Last edited by droomagon; 10-21-2009 at 05:48 AM.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •