Automatic Login

dragoneye_xp

New Member
Messages
330
Reaction score
0
Points
0
I wrote a script called "Dragoneye's Login Utility" that people can use to log into HTTP, HTTPS and FTP servers and added an optional autologin feature so it will act as a keepalive function -- every time someone goes to the home page, it will connect to all the servers in the autologin list (which is encrypted many times, by the way), then disconnect.

I got the idea of using that feature to automatically connect and disconnect from my CPanel account every time my homepage is accessed so that I don't have to do it myself every two weeks. But when I tried testing to see if that would work with PHP fopen(), I get this error:

Warning: fopen(http://...@): failed to open stream: Success in autologin.php on line 49

What's that mean and how do I fix it?
 

bigguy

Retired
Messages
10,984
Reaction score
10
Points
38
Whats on line 49 of your autologin.php ? This is obvious but its failing to open something or it looks that way.
 

Bryon

I Fix Things
Messages
8,149
Reaction score
101
Points
48
PHP:
Warning: fopen([url]http://...@[/url]): failed to open stream: Success in autologin.php on line 49

Is that the exact error? If it is, it's because your trying to open a stream with the URL "http://...@", which obviously is not a site/page/whatever.

Also, I wouldn't recommend everytime someone goes to your page having it login. Make a cron script to do it once a day.. :-/ Whatever floats your boat though.
 

dragoneye_xp

New Member
Messages
330
Reaction score
0
Points
0
No, I use the $username.":".$password (but I guess PHP censors that part so people can't see your password.)
 

dragoneye_xp

New Member
Messages
330
Reaction score
0
Points
0
Here's the peice of code directy from the file that does that. Anything wrong with it?

Code:
for($x=0; $x<count($userfile); $x++){
	$line=explode("||",trim(decoder($userfile[$x])));
	$readuser=trim(urlencode(decoder($line[0])));
	$readpass=trim(urlencode(decoder($line[1])));
	$readsrv=trim(decoder($line[2]));
	$readtype=trim(decoder($line[3]));
	
	$fp=fopen($readtype.$readuser.":".$readpass."@".$server, "r");
	if($fp) echo $readuser."@".$readtype.$readsrv.": <font color='#00FF00'> Login successful.</font><br>";
	else echo $readuser."@".$readtype.$readsrv.": <font color='#FF0000'> Couldn't log in.</font><br>";
}
 
Last edited:
Top