Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

php - grabbing a page by url (that requires auth)

  • 27-09-2008 8:09pm
    #1
    Closed Accounts Posts: 7,145 ✭✭✭


    I've toyed around with this before and hit a dead end...
    What I'm trying to do is write a php script that'll retrieve a page of html from my router's config interface (for logging and processing stats).

    The only problem is that the page requires authentication (in the form of a pop-up box, which looks like the .htaccess one).
    What I'm not sure how to do is send the username/password with my request.

    Can someone point me in the direction of what functions I should be looking at? :confused:


Comments

  • Registered Users, Registered Users 2 Posts: 9,579 ✭✭✭Webmonkey


    Usually you can access a page like that using:

    http://username:thepassword@http://192.168.0.1.

    Alternatively if using something like cURL - you can pass it as a parameter afaik.


  • Registered Users, Registered Users 2 Posts: 2,120 ✭✭✭p


    Take a look at PHP Curl. It's designed for logging into sites, testing, screen scraping, etc...


  • Closed Accounts Posts: 7,145 ✭✭✭DonkeyStyle \o/


    Cheers guys, I'll check out Curl.


Advertisement