• Some users have recently had their accounts hijacked. It seems that the now defunct EVGA forums might have compromised your password there and seems many are using the same PW here. We would suggest you UPDATE YOUR PASSWORD and TURN ON 2FA for your account here to further secure it. None of the compromised accounts had 2FA turned on.
    Once you have enabled 2FA, your account will be updated soon to show a badge, letting other members know that you use 2FA to protect your account. This should be beneficial for everyone that uses FSFT.

web script problem - php curl?

Billiam411

Limp Gawd
Joined
Aug 13, 2005
Messages
197
hey, im a newbie programmer, ive got extensive html knowledge but not that much php or sql.
heres my situation:
there is a website (with its own domain) with a login and password, after logging in it takes you to a page containing a table with 3 pieces of data per cell.

i want to be able to have a script on my own server that will login to the site remotely, then view the data in the cells, strip/parse them into some sort of file (xml?) then display that data in a more organized form of my choosing. there will be new cells of data added to the main site occasionally, so having the date and time that they were updated (this means including an autorefresh) in the row would be preferred.

optional features (that would make it substantially more difficult i believe)
having fields for login and password, therefore allowing anyone with credentials on the main site to be able to log into this script and view their own data (each user will have different data). this would require a database i believe, correct?
having buttons next to each row of data (each row would contain the information of one cell from the site) that will hide the row, or mark it as various statuses.

is this possible? how hard would it be? a friend suggested using the curl library but i dont know how to go about starting this.

thanks in advance
 
You could use both flat files or a database if you want to store data. The latter is desirable if there's more traffic and frequent updates, with caching a good idea if there's a lot of traffic and relatively static output.

Using CURL to retrieve the page is possible, yeah. It supports both HTTP and HTTPS, so there should be no issues.

Since you're using PHP already, implementing the optional features you listed shouldn't be too hard either. If you want to go totally crazy you could even use AJAX for some of them :)
 
i'm not particularly familiar with the exact features/workings of curl but i have used PEAR::HTTP_Request

it can make http requests and includes specifying get/post, get/post paramaters, getting/setting cookies, etc.

basically you make the first request to the login page providing the form data, grab the cookies you were sent from the result (assuming your site uses cookies for login) and send the cookies on a second request to the actual page you're interested in.

i haven't used PEAR:HTTP_Client since i didn't see it before when i was using http_request but it looks like it can make it easier to handle the cookies.
 
alright, thanks guys this should put me in the right direction now.
so what can i use to actually strip the data before/after writing it to a text/sql table?
 
alright, i seem to have thrown together a frontend for this, after someone else decided to put together the backend, but right now i seem to have lost my scroll bar, even though the page extends below the bottom of the browser, can anyone help me out with this? thanks
heres an html of the page, since you would have to login to view the php version

http://68.62.8.89/tracker.php.htm

i have a feeling it involves some of the javascript on the page. any help? thanks

edit: nvm figured it out, i guess i was messing with the css at one point and added position:absolute which caused that to happen
 
Back
Top