galvin Posted October 4, 2010 Share Posted October 4, 2010 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. Link to comment https://forums.phpfreaks.com/topic/215087-help-with-sending-info-to-remote-server-using-php/ Share on other sites More sharing options...
BillyBoB Posted October 4, 2010 Share Posted October 4, 2010 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>'; Link to comment https://forums.phpfreaks.com/topic/215087-help-with-sending-info-to-remote-server-using-php/#findComment-1118726 Share on other sites More sharing options...
galvin Posted October 4, 2010 Author Share Posted October 4, 2010 Figured as much, but that still isn't the issue. I fixed the syntax and still get the same "bad request" errors. If anyone can explain how to put together the cURL code using the info I provided, I would GREATLY appreciate it. Thanks, Link to comment https://forums.phpfreaks.com/topic/215087-help-with-sending-info-to-remote-server-using-php/#findComment-1118741 Share on other sites More sharing options...
cherran Posted October 4, 2010 Share Posted October 4, 2010 I'm not sure if I can be any help but trying. Why can't you use some PHP RSS processro script to extract that information. Link to comment https://forums.phpfreaks.com/topic/215087-help-with-sending-info-to-remote-server-using-php/#findComment-1118870 Share on other sites More sharing options...
galvin Posted October 4, 2010 Author Share Posted October 4, 2010 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. Link to comment https://forums.phpfreaks.com/topic/215087-help-with-sending-info-to-remote-server-using-php/#findComment-1118934 Share on other sites More sharing options...
phpfreakjav Posted October 4, 2010 Share Posted October 4, 2010 Like a webservice. Very interesting. I will find out and come back to tell you the issue. Link to comment https://forums.phpfreaks.com/topic/215087-help-with-sending-info-to-remote-server-using-php/#findComment-1119032 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.