file_get_content into excel sheet

I’m trying to view content from a website that is secured. It makes me login into to view the content.

[LEFT]<?php
$homepage
= file_get_contentsFONT=Consolas;
echo [/FONT]
$homepage;
?>[/LEFT]

What I’m trying to is to be able to view the content without having to view it in the browser.

I just want to run the script from my desktop. Download the data into an excel sheet.

Down in the future, I might categorize the information that gets displayed.

Can someone give me any advice?

I see it can be done in C#, but something like this be developed in php?

// prepare the web page we will be asking for HttpWebRequest request = (HttpWebRequest) WebRequest.[COLOR=#2B91AF]Create/COLOR; // execute the request HttpWebResponse response = (HttpWebResponse)request.[COLOR=#2B91AF]GetResponse/COLOR; // we will read data via the response stream Stream resStream = response.[COLOR=#2B91AF]GetResponseStream/COLOR; string tempString = null; int count = 0; do { // fill the buffer with data count = resStream.Read(buf, 0, buf.Length); // make sure we read some data if (count != 0) { // translate from bytes to ASCII text tempString = Encoding.ASCII.GetString(buf, 0, count); // continue building the string sb.[COLOR=#2B91AF]Append/COLOR; } } while (count > 0); // any more data to read?

I think the tool you are seeking is cURL, ie possibly automating the submitting of a POST form with your credentials.

check http://davidwalsh.name/curl-download

standard CURL disclaimer
Make sure you have permission to scrape the data from the target site; most sites prohibit such activity.

Thanks, for the link. How do I actually run the script?

I’m closing this thread as the OP did not clarify their intention regarding scraping. To give you an idea Sitepoint uses lawyers to go after web scrapers that pull material off this site. We don’t condone scraping.

If Blake PMs me @ServerStorm and clears his intentions then I may reopen this thread.

I’ve reopened the thread, thanks for clarifying your intentions Blake.

Regards,
Steve

It’s in the example: $theContent = get_data(‘http://davidwalsh.name’); :slight_smile: