Jump to content

Help with sending info to remote server using PHP?


galvin

Recommended Posts

I have this XML...

$xml = '<?xml version="1.0" encoding="utf-8"?>' .
       '<LeadImportDatagram>'.
           '<CompanyKey>' . $companyKey . '</CompanyKey>' .
           '<NotificationEmailTo>[email protected]</NotificationEmailTo>' .
           '<LeadInfo>';
           '<City>Osweeego</City>';
          '</LeadInfo>' .
        '</LeadImportDatagram>';

 

and I need to use PHP to submit that XML to a remote server at a address in this format (http://XX.XXX.XXX.XXX/xml/importlead.asp) so that the remote server can process the info.

 

Can anyone out there tell me how to do that?  It seems like I have to use cURL and I've tried multiple times but keep getting "bad request" errors.

 

SIDE NOTE: Is my syntax wrong?  Someone else helped me write that $xml variable, but it seems weird to me that some lines end with periods and some end with semicolons.

 

 

lol is your syntax wrong? Just a lil try:

 

$xml = '<?xml version="1.0" encoding="utf-8"?>' .
       '<LeadImportDatagram>'.
           '<CompanyKey>' . $companyKey . '</CompanyKey>' .
           '<NotificationEmailTo>[email protected]</NotificationEmailTo>' .
           '<LeadInfo>'.
           '<City>Osweeego</City>'.
          '</LeadInfo>' .
        '</LeadImportDatagram>';

May not be understanding what you're asking, but I am not extracting any info from the remote server address, I am just sending info to that server and it will process the info on their end.  I am just trying to figure out the code to simply send my XML to this remote address.

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.