Hi,

On Fri, Aug 20, 2010 at 8:17 PM, Brendan Brink
<[email protected]> wrote:
> Hi there Jochen,
>
> Thanks for your assistance.
>
> However am not familiar with host file entrys etc.

On linux there is a file /etc/hosts. On Windows, there is a file
c:\windows\system32\drivers\etc\hosts (careful to open as admin user,
otherwise you get it created in your user directory)

Both variants take a line with an IP address, multiple spaces and a
line of text (the DNS name)

10.0.0.1 test

If you open in your browser http://test it gives exactly the same
result as opening http://10.0.0.1

> Is there a PHP function I can use to perform these and call the URL
> mentioned below?

no. Use notepad/nano

> If you put it in the URL address, it returns XML as it should.
>
> Just need a way to call this from a PHP script and store the XML to a
> variable...

yes, but the server at this address looks at some other information
apart from the URL as well. If I open this url:

http://121.98.150.62:5574/Invoice?txtcode=R5W2

I get an XML file, but my browser sends the following request headers:

Host: 121.98.150.62:5574
User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.8)
Gecko/20100723 Ubuntu/10.04 (lucid) Firefox/3.6.8
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 115
Connection: keep-alive


If you send all these request headers as well, then the server won't
be able to distinguish your curl client from the browser client. If
you need to see what headers curl actually sends, you can try
Wireshark (though it will require a bit of time to get your head
around it)

HTH, Jochen

-- 
NZ PHP Users Group: http://groups.google.com/group/nzphpug
To post, send email to [email protected]
To unsubscribe, send email to
[email protected]

Reply via email to