Re: [PHP] XML Sending problem

2006-11-06 Thread Richard Lynch
On Sun, November 5, 2006 5:28 am, Rosen wrote:
 I need to create an XML file and send it to another server, where
 script
 process the XML.
 With creation and processing of XML I don't have a promlems, but how I
 can
 send XML to the processing script on another server ?

Pigeons?

It would probably be EASIEST to just make your .xml file available on
YOUR server, and let that other server get it whenever it wants...

That pretty much describes RSS in a nutshell...

-- 
Some people have a gift link here.
Know what I want?
I want you to buy a CD from some starving artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] XML Sending problem

2006-11-05 Thread Rosen
Hi,

I need to create an XML file and send it to another server, where script 
process the XML.
With creation and processing of XML I don't have a promlems, but how I can 
send XML to the processing script on another server ?


Thanks in advance,
Rosen 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] XML Sending problem

2006-11-05 Thread Michal Manko

Hi Rosen,
You can do this for some ways.
The simplest:
1. Send via ftp - http://php.net/ftp
2. Send via scp using ssh2 - http://php.net/ssh2

Regards
Michael

Rosen said:

Hi,

I need to create an XML file and send it to another server, where script 
process the XML.
With creation and processing of XML I don't have a promlems, but how I can 
send XML to the processing script on another server ?



Thanks in advance,
Rosen 



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] XML Sending problem

2006-11-05 Thread Rosen

Unknown Sender [EMAIL PROTECTED] wrote in message 
news:[EMAIL PROTECTED]
 Hi Rosen,
 You can do this for some ways.
 The simplest:
 1. Send via ftp - http://php.net/ftp
 2. Send via scp using ssh2 - http://php.net/ssh2

 Regards
 Michael

Thanks Michael, but I want if it is possible to do something like POST in 
normal HTML language and say to the remote script to process XML. And I 
don't have FTP access to remote server. The idea is to working only with XML 
protocol to communicate with remote server. I think I have read something 
like this in the internet, but can't remember where :(

Regards
Rosen



 Rosen said:
 Hi,

 I need to create an XML file and send it to another server, where script 
 process the XML.
 With creation and processing of XML I don't have a promlems, but how I 
 can send XML to the processing script on another server ?


 Thanks in advance,
 Rosen 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] XML Sending problem

2006-11-05 Thread Stut

Rosen wrote:
Unknown Sender [EMAIL PROTECTED] wrote in message 
news:[EMAIL PROTECTED]

Hi Rosen,
You can do this for some ways.
The simplest:
1. Send via ftp - http://php.net/ftp
2. Send via scp using ssh2 - http://php.net/ssh2

Regards
Michael

Thanks Michael, but I want if it is possible to do something like POST in 
normal HTML language and say to the remote script to process XML. And I 
don't have FTP access to remote server. The idea is to working only with XML 
protocol to communicate with remote server. I think I have read something 
like this in the internet, but can't remember where :(


XML is not a protocol, but that's really not the point.

Have a look at the CURL functions: http://php.net/curl

-Stut

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] XML Sending problem

2006-11-05 Thread Myron Turner

Your question interested me for my own work, so I found this url:
   http://www.zend.com/zend/spotlight/mimocsumissions.php

The script, disentangled from the commentary ( with a few of my own 
comments) is as follows:




function post_it($datastream, $url)
{

  $url = preg_replace(@^http://@i;, , $url);
  $host = substr($url, 0, strpos($url, /));
  $uri = strstr($url, /);

  $reqbody = ;
  foreach($datastream as $key=$val) {
  if (!empty($reqbody)) $reqbody.= ;
  $reqbody.= $key.=.urlencode($val);
  }

			// the trick here is to know that the Host 	// header identifies 
the script, not the uri

  $contentlength = strlen($reqbody);
  $reqheader =  POST $uri HTTP/1.1\r\n.
   Host: $host\n. User-Agent: PostIt\r\n.
  Content-Type: application/x-www-form-urlencoded\r\n.
  Content-Length: $contentlength\r\n\r\n.
  $reqbody\r\n;

$socket = fsockopen($host, 80, $errno, $errstr);

   if (!$socket) {
  $result[errno] = $errno;
  $result[errstr] = $errstr;
  return $result;
   }

  fputs($socket, $reqheader);

  while (!feof($socket)) {
 $result[] = fgets($socket, 4096);
  }

  fclose($socket);

  return $result;

}

?

?php

  $data[xml] = $xml_data; //here of course xml will be 
replaced by 	// your own name for the value $xml_data



  $result = post_it($data, 			 
http://www.example.com/cgi-bin/test/script.php;);


  if (isset($result[errno])) {
$errno = $result[errno];
$errstr = $result[errstr];
echo BError $errno/B $errstr;
exit;
  } else {

for($i=0;$i count($result); $i++) echo $result[$i];

  }

?

Rosen wrote:
Unknown Sender [EMAIL PROTECTED] wrote in message 
news:[EMAIL PROTECTED]

Hi Rosen,
You can do this for some ways.
The simplest:
1. Send via ftp - http://php.net/ftp
2. Send via scp using ssh2 - http://php.net/ssh2

Regards
Michael

Thanks Michael, but I want if it is possible to do something like POST in 
normal HTML language and say to the remote script to process XML. And I 
don't have FTP access to remote server. The idea is to working only with XML 
protocol to communicate with remote server. I think I have read something 
like this in the internet, but can't remember where :(


Regards
Rosen




Rosen said:

Hi,

I need to create an XML file and send it to another server, where script 
process the XML.
With creation and processing of XML I don't have a promlems, but how I 
can send XML to the processing script on another server ?



Thanks in advance,
Rosen 



--

_
Myron Turner
http://www.room535.org
http://www.bstatzero.org
http://www.mturner.org/XML_PullParser/

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php