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?