[Sussex] For all you PHP / PERL gurus out there...

Mark Harrison Mark at ascentium.co.uk
Fri Jul 30 16:31:20 UTC 2004


Here's an interesting one for you.

Can I call an HTTP page from WITHIN a PHP or PERL script?

I have a legacy server whose only presented interface is itself a web server. The web server in question is kind of messy, and intended for querying by a particular embedded hardware client rather than by a human driving a browser. Nonetheless, point a browser at it gives a structured response.

I'm trying to write a human-friendly interface so that the content can be viewed with a web browser in a human-readable format. For various reasons, it makes sense to write this as something that is, itself, a server-side script, rather than a client-side application.

Hence, can I call an HTTP page from WITHIN a PHP or PERL script (I'm not fussed which.)

If I can, then I can use either of those languages to parse the content and generate a much prettier web page (including generating links to drill down further, which is the purpose behind all this.)

I realise that I _could_ shell out to the operating system, run something like Lynx, and then take its STDOUT into STDIN, but this would immediately force a particular piece of client software onto the middleware server, which I don't want for O/S portability reasons.

Any ideas?

Mark

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.lug.org.uk/pipermail/sussex/attachments/20040730/00a67a3d/attachment.htm 


More information about the Sussex mailing list