Jump to content


Photo

Stay Logged In When Im Offline Using PHP


  • Please log in to reply
12 replies to this topic

#1 JayLewis

JayLewis
  • Members
  • PipPipPip
  • Advanced Member
  • 79 posts

Posted 19 October 2006 - 02:29 PM

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!

#2 trq

trq
  • Staff Alumni
  • Advanced Member
  • 31,041 posts

Posted 19 October 2006 - 02:34 PM

Yeah its possible. Maybe take a look at curl.

#3 JayLewis

JayLewis
  • Members
  • PipPipPip
  • Advanced Member
  • 79 posts

Posted 19 October 2006 - 02:36 PM

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!

#4 printf

printf
  • Staff Alumni
  • Advanced Member
  • 889 posts

Posted 19 October 2006 - 02:36 PM

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!

#5 JayLewis

JayLewis
  • Members
  • PipPipPip
  • Advanced Member
  • 79 posts

Posted 19 October 2006 - 02:42 PM

how should i grab the session ID?

#6 printf

printf
  • Staff Alumni
  • Advanced Member
  • 889 posts

Posted 19 October 2006 - 02:43 PM

is cookie or url based?

me!

#7 JayLewis

JayLewis
  • Members
  • PipPipPip
  • Advanced Member
  • 79 posts

Posted 19 October 2006 - 02:45 PM

http://82.42.115.70/site/base.php

take a look yourself mate

Username: JayLewis
Password: jcity

#8 printf

printf
  • Staff Alumni
  • Advanced Member
  • 889 posts

Posted 19 October 2006 - 02:51 PM

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!

#9 JayLewis

JayLewis
  • Members
  • PipPipPip
  • Advanced Member
  • 79 posts

Posted 19 October 2006 - 02:52 PM

thank you very much!!

much appreciated!

Thanks,

Jay!

#10 JayLewis

JayLewis
  • Members
  • PipPipPip
  • Advanced Member
  • 79 posts

Posted 19 October 2006 - 03:24 PM

something like this?

<?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;
?>

or not ... :P

#11 JayLewis

JayLewis
  • Members
  • PipPipPip
  • Advanced Member
  • 79 posts

Posted 19 October 2006 - 05:22 PM

:)

#12 JayLewis

JayLewis
  • Members
  • PipPipPip
  • Advanced Member
  • 79 posts

Posted 19 October 2006 - 05:51 PM

email the solution to:

Jay_Lewis69@hotmail.com
or
Netty2oo6@hotmail.com

Thanks

Jenette!

#13 JayLewis

JayLewis
  • Members
  • PipPipPip
  • Advanced Member
  • 79 posts

Posted 20 October 2006 - 06:24 PM

so is there nobody who can help me?




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users