SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 2004
    0 Post(s)
    0 Thread(s)

    Adding variables automatically to include order data in newsletter list/script/db.


    I have a newsletter script that allows me to integrate it with my shopping cart, but it is not that easy...well not for me!

    I want to add the name and email from the orders, which use the variables: $ordName and $ordEmail in the shopping cart, to the php script provided by newsletter script coder, but can't figure out how.

    Here is the script, I should use for integration, provided by the newsletter script coder:

    //RegisterProspect function will send all information to register.cgi
    //Here is exaple of using this fuction
    //RegisterProspect('','John Doe');
    function RegisterProspect($email,$name)
        $ch = curl_init();
        curl_setopt($ch, CURLOPT_URL,"$URL");
        curl_setopt($ch, CURLOPT_POST, 1);
        curl_setopt($ch, CURLOPT_POSTFIELDS,
        curl_exec ($ch);
        curl_close ($ch);

    I have made it work as a test by simply uncommenting the fourth line: "//RegisterProspect('','John Doe');" and the sample data was added to my newsletter list.

    However, I don't want to add "" and "John Doe" to my newsletter list since that was only a test with some samples. So, my questions are:

    • How can I grab the contents from the order itself knowing that the variables I am supposed to use are $ordName and $ordEmail ?
    • How could I transfer/add those order variables automatically to the function on the fourth line?

    Thanks in advance!


  2. #2
    Avid Logophile silver trophy
    ParkinT's Avatar
    Join Date
    May 2006
    Central Florida
    192 Post(s)
    4 Thread(s)
    In a page where $ordName and $ordEmail are in scope, you would call:
    RegisterProspect($ordEmail, $ordName);
    That is probably somewhere in the Shopping Cart code (on a page that is part of the Shopping Cart system)
    Don't be yourself. Be someone a little nicer. -Mignon McLaughlin, journalist and author (1913-1983)

    Git is for EVERYONE
    Literally, the best app for readers.
    Make Your P@ssw0rd Secure
    Leveraging SubDomains


Posting Permissions

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