[PHP] PHP and send XML

2004-10-28 Thread Victor C.
Hi,

I'm trying to pass XML file from Site  A to Site B for Site B to parse.
Site B is maintained by other company, so I only need to worry about sending
over the XML file. I've been hinted that fsockopen() can do the job.

I've done the following through PHP:

$port=80;
$host=134.134.134.134
$data=

POST /folder1/ HTTP/1.0
Host: 134.134.134.134
User-Agent: Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0)
Content-Type: application/x-ddif
Content-Length: 301

blabla
version100/version
securityTYPE1/security
authrq
tsclient20041028065058:534Pacific Daylight TimeBR/tsclient
 appid/appid
appverappver
/authrq
profrq
localeen_CA/locale
/profrq
/blabla


then i wrote in PHP.

fclose($f);
$result=;
echo $f=fsockopen($host,$port, $errno, $errstr, 30);
fputs($f,$msg,$data);
while (!feof($f)) $result.=fread($f,32000);
fclose($f);
echo $result;

Since I still do not have the HOST info. on site B.  I'm doing testing by
setting the $host to be my own site (ie, Site A's)  host ip.
Right now when I execute the code, the page just keeps on running and
nothing shows up.. Is this how it's suppose to behave?

Thanks a lot.

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



Re: [PHP] PHP and send XML

2004-10-28 Thread Matt M.
 I'm trying to pass XML file from Site  A to Site B for Site B to parse.
 Site B is maintained by other company, so I only need to worry about sending
 over the XML file. I've been hinted that fsockopen() can do the job.

if you have to do this I would suggest giving pear a try, no need to
reinvent the wheel.

http://pear.php.net/package/HTTP_Client

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