Re: send XML thru POST

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Remove http://

On Fri, 2004-06-11 at 10:27, Joakim Ling, Lokalguiden wrote:
> Hmm, ok. 
> 
> $fp = fsockopen ("http://kontaktamig.telia.se";, 80, $errno, $errstr,
> 30);
> fputs($fp, "POST /servlet/teliawebforms.SendXMLISO HTTP/1.0\r\n");
> 
> Correct?
> 
> 
> "B.A.T. Svensson" <B.A.T.Svensson@xxxxxxx> skrev i meddelandet
> news:<D291F33C586C8E48B95C26F8C805513A0303C15C@xxxxxxxxxxxxx>...
> You have probaly sumbited and URL instead of a host address then. Or
> your host address is invalid - try the IP# of the host - this may
> indicate a problem to do a DNS lookup.
> 
> -----Original Message-----
> From: Joakim Ling, Lokalguiden
> To: Svensson, B.A.T. (HKG); php-windows@xxxxxxxxxxxxx
> Sent: 11-6-2004 9:52
> Subject: Re:  send XML thru POST
> 
> Warning: fsockopen(): php_network_getaddresses: gethostbyname failed in
> c:\inetpub\wwwroot\tmp\telia.php on line 3
> 
> Warning: fsockopen(): unable to connect to <address>:80 in
> c:\inetpub\wwwroot\tmp\telia.php on line 3 ÃtgÃrden har slutfÃrts. (0)
> 
> Its like it cant find the server, but the ASP connection works. Any
> ideas?
> 
> 
> 
> "B.A.T. Svensson" <B.A.T.Svensson@xxxxxxx> skrev i meddelandet
> news:<D291F33C586C8E48B95C26F8C805513A0303C15B@xxxxxxxxxxxxx>...
> > And what is the error message you get then?
> > 
> > -----Original Message-----
> > From: Joakim Ling, Lokalguiden
> > To: php-windows@xxxxxxxxxxxxx
> > Sent: 11-6-2004 9:21
> > Subject:  send XML thru POST
> > 
> > Hi
> > 
> > Im tring to send XML thru POST to a server. I have a demo in asp that
> > works fine but how do I write this in php.
> > 
> > This is the ASP demo
> > sXML = "<?xml version=""1.0"" encoding=""ISO-8859-1""
> > Set oHttpConn = CreateObject("MSXML2.ServerXMLHTTP")
> > Call oHttpConn.Open("POST", sURL, False)
> > Call oHttpConn.setRequestHeader("Content-Type", "Text/xml")
> > Call oHttpConn.send(sXML)
> > sXMLResponse = oHttpConn.responseText
> > Set oHttpConn = Nothing
> > 
> > 
> > I tried this from the php-manual but no result. Its like it cant find
> > the remote server.
> > 
> > $fp = fsockopen ($sUrl, 80, $errno, $errstr, 30);
> > $msg =  "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"";
> > if (!$fp) {
> >     print("$errstr ($errno)<br>\r\n");
> > } else {
> >  if ($fp) {
> >   fputs($fp, "POST /$sUrl HTTP/1.0\r\n");
> >   fputs($fp, "Content-Type: text/xml\r\n");
> >   fputs($fp, "Content-Length: ".strlen($msg)."\r\n");
> >   fputs($fp, "\r\n");
> >   fputs($fp, $msg);
> >   $content = 0;
> >   $reply = array();
> >   while (!feof($fp)) {
> >    echo fgets ($fp,128);
> >   }
> >   fclose($fp);
> >  }
> > }
> > 
> > 
> > Thanks for help..  // Jocke
> > 
> > --
> > PHP Windows Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> ----------
> 

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


[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Database Programming]     [PHP Install]     [Kernel Newbies]     [Yosemite Forum]     [PHP Books]

  Powered by Linux