[Resolved] Fopen a secure area

SpaceshipSpaceship
Namecheap AuctionsNamecheap Auctions
Namecheap AuctionsNamecheap Auctions
Watch

Camron

VIP Member
Impact
44
fopen a secure area

What I'm trying to do is something like this:

PHP:
$fh = fopen("http://USER:[email protected]/something.cgi", 'r') or die("ERROR");
fclose($fh);

Thing is, I keep getting errors like it could not login/open the file. Any ideas how I could do this. I don't necessarily have to use fopen, although I tried file_get_contents and it still didn't work.

Any help is much appreciated :)
 
0
Close
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
Last edited:
0
Close
Doesn't seem to be working, included the class & used the above example but it doesn't seem to be doing anything at all. Doesn't even show any errors on the page.

I thought fopen should work, but it doesn't for some reason.

Edit, this is the error I get using fopen (I don't get anything using your curl class)

Code:
Warning: fopen(http://...@<domain>/<file>.cgi) [function.fopen]: failed to open stream: HTTP request failed! HTTP/1.0 401 Unauthorized in /file/folder/reboot.php on line 44

And line 44 is:
PHP:
$fh = fopen("http://USER:[email protected]/file.cgi", 'r') or die("ERROR");
fclose($fh);

I have also doubled checked copy & pasting the site (http://USER:[email protected]/file.cgi) and it loads just fine.
 
Last edited:
0
Close
Well, using what I posted, $data would have everything from the page you're trying to get. You need to echo it to show it.

I tested it logging into cPanel and it worked.
 
1
Close
Dan said:
Well, using what I posted, $data would have everything from the page you're trying to get. You need to echo it to show it.

I tested it logging into cPanel and it worked.

Ah, got it to work. In $data I put http// instead of http:// which is the reason why it didn't work.

Thanks for your help, rep coming your way!
 
0
Close
Curl is faster... and much better to use
 
0
Close
Jawn said:
Curl is faster... and much better to use

That's what I ended up using.

Thanks!
 
0
Close
DomainEasy: flexible LTO options. Close more domain deals with financing.

We're social

Escrow.com
Spaceship
Domain Recover
CryptoExchange.com

NamePros updates

Filters for activity feeds
Your news feed, Latest activity, and the activity tab on profiles now have filter buttons: All, Posts, Quick replies, and Other. Your...
AIVikings
Catchy
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back