Jump to content

Need method to send captured lead to external source then send post back receipt


n1concepts

Recommended Posts

Hi,

 

I'm trying to setup a quick PHP script that will grab the email from the url (see below) and after inserting into MySQL db - which is working fine - the script will complete two additional tasks:

 

1. send that same captured email out to a external db as in shown via http://domain1.com/insert.php?email=$lead (example), but then send to a DIFFERENT source - the originator of the lead - a portback acknowledgement using Header (sending the status and email to http://domain2.com/check.php?e=$lead&s=$status for their records).

 

See the code below:

-------------------------

 


$lead = $_REQUEST['e_mail'];                // will grab email from posted url string and assign to local variable
$result = mysql_query($command);      // this is just to execute the MySQL insert which works just fine but included here to explain validation below

// Create API Call string to insert lead into iContact folder
$requestURL = "http://domain1.com/insert.php?email=$lead";

// Execute API Call to CAKE
$xml = simplexml_load_file($requestURL) or die("feed not loading");


if ($result) {
    $status = 1;       // mark lead as sucess

    // send postback on lead status
    header("Location: http://domain2.com/check.php?e=$lead&s=$status");
}

--------

 

Problem: I'm getting all sorts of errors with the simplexml_load_file() function and can't figure out why it won't work.

Any input appreciated as this the only way I know how to pass the lead onward and then inform/update the other party of receipt of information.

 

thx!

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.