Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

File_get_contents for a passworded page

Posted on 2006-10-26
3
Medium Priority
?
249 Views
Last Modified: 2008-03-17
Hi all,
I used to use

file_get_contents("http://username:password@site.com"); to get pages that were password protected, however recently im getting 401 errors, does anyone know another way of doing this?

0
Comment
Question by:fox_statton
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 18

Expert Comment

by:Mark Gilbert
ID: 17816593
If it's a password protected website, chances are they have passworded it to protect the content contained therein and don't want the information splashed about the place.  

Such activities, or obtaining information that someone else has protected for some such reason are considered hacking.  We experts at EE respect other peoples wishes, and don't infringe on such protections, and our personal ethics prohibit that too.  If you are allowed to view and access such content for external presentation, then the site owners will be able to provide you with the means to present that information on your own application with code that they are happy with.  Other than that, from what I understand, experts at EE will not be able to assist you further.

See the following pages for more information:

http://www.experts-exchange.com/memberAgreement.jsp
http://www.experts-exchange.com/help.jsp
0
 
LVL 143

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 1992 total points
ID: 17817247
hi,

  if you used that code and it was working, then the error 401 now means that the access using that way has been blocked on some point of the way (for whatever reason).
  you should contact the owners/admins of the site.com to check with them, because there is no other way.
  opening a page over http works only like that.

angelIII, page editor
0
 
LVL 18

Expert Comment

by:Mark Gilbert
ID: 17823953
Hmm, fox, it appears that I may have missinterpreted your question some how, which lead me to answering in the way that I did.  It does appear after further review that you were able to perform the actions you wanted to do in a password protected environment, but as Angel has stated, things seem to have changed to the incompatability of your script.  Contact the web master or developer(s) of the website you are trying to obtain information from and see how their code has chaged.  Change your script(s) to fit their new way and things should function as normal.
0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to count occurrences of each item in an array.
Suggested Courses

597 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question