Jump to content

Archived

This topic is now archived and is closed to further replies.

JayLewis

Stay Logged In When Im Offline Using PHP

Recommended Posts

I am trying to find a way to stay logged into a website when i go offline.

Using my webspace i want to upload a script that i can execute and will log me into the desired website.

Becuase my host ever goes offline, the script will be running keeping me online ...

is this possible?

Thanks.

Jay!

Share this post


Link to post
Share on other sites
Yeah its possible. Maybe take a look at [url=http://php.net/curl]curl[/url].

Share this post


Link to post
Share on other sites
thanks,

but did i mention im a total n00b when it comes to PHP? :P

a little bit of guidence wud be nice if you have the time...

Thanks,

Jay!

Share this post


Link to post
Share on other sites
ya, login, grab the session cookie or the session id in the url, then begin a socket refresh loop with a sleep interval using a place holder, so when you want to exit the loop, you delete the place holder!

me!

Share this post


Link to post
Share on other sites
http://82.42.115.70/site/base.php

take a look yourself mate

Username: JayLewis
Password: jcity

Share this post


Link to post
Share on other sites
I have to go to a board meeting right now, but when I get back I will write you a quick script to do this!

me!

Share this post


Link to post
Share on other sites
something like this?

[code]<?php
$url = "http://82.42.115.70/index.php";
$url2 = "http://82.42.115.70/site/base.php";
$ch = curl_init(); // initialize curl handle
curl_setopt($ch, CURLOPT_URL,$url); // set url to post to
curl_setopt($ch, CURLOPT_FAILONERROR, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 0);// allow redirects
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); // return into a variable
curl_setopt($ch, CURLOPT_TIMEOUT, 3); // times out after 4s
curl_setopt($ch, CURLOPT_POST, 1); // set POST method
curl_setopt($ch, CURLOPT_POSTFIELDS, "remember=1&login_submit=1&user=Jay69&password=Jay69"); // add POST fields
curl_setopt($ch, CURLOPT_URL,$url2);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); // return into a variable
curl_setopt($ch, CURLOPT_POST, 1); // set POST method
curl_setopt($ch, CURLOPT_POSTFIELDS, "raidid=3668760"); // add POST fields
$result = curl_exec($ch); // run the whole process
curl_close($ch);
echo $result;
?>[/code]

or not ... :P

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.