Re: Retrieve HTML page

From: Date: Fri, 02 Feb 2001 14:30:15 +0000
Subject: Re: Retrieve HTML page
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-37839@lists.php.net to get a copy of this message
On Thu, 1 Feb 2001, Jared Howard wrote: > I need to know if there is a way to get a specified HTML page (as if you > were to go to the page by typing in the url in your browser) and either > turn it into a string or array or something that I would be able to cut up > and use the information that I need. This way PHP does the work instead of > going to the page yourself. We did this on a project once. Some of our PHP pages were written to be a back end, so needed to be called *by* other php pages, not included in them. This was so our designers could do with as little php as possible. It also allowed us to standardize on an XML abstraction layer between all pieces of the project. I'd suggest looking into fsockopen. If you know how, you can set it up to poke through any corporate firewall you may be using, and if you know the HTTP spec, you can send anything through the connection, not just HTML. This technique is often employed by "page strippers" that take info from other sites, re-parse it for useful information, and make it part of the current page. We also used fsockopen to directly connect to pop3 and ftp servers before the functionality was added in php4. You'd be amazed what you can learn from an RFC. -- +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-+ | Shaun M. Thomas INN Database Programmer | | Phone: (309) 743-0812 Fax : (309) 743-0830 | | Email: sthomas@townnews.com AIM : trifthen | | Web : hamster.lee.net | | | | "Most of our lives are about proving something, either to | | "ourselves or to someone else." | | -- Anonymous | +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-+

« previous php.general (#37839) next »