开发者

Password protected page, how to access it with PHP?

开发者 https://www.devze.com 2023-04-06 02:19 出处:网络
Say I have a page which is password protected with cPanel\'s directory password type of thing (htaccess), how could I access this page using PH开发者_Python百科P? So the php script would:

Say I have a page which is password protected with cPanel's directory password type of thing (htaccess), how could I access this page using PH开发者_Python百科P? So the php script would:

  1. Go to the password protected URL
  2. Enter the username
  3. Enter the password
  4. Return true if it worked, false if it didnt

Any help would be greatly appreciated.


Check out cURL.

You can set the connection options for CURLOPT_HTTPAUTH and pass the credentials. There's actually a user comment containing code that should help you get started with Basic Auth.

0

精彩评论

暂无评论...
验证码 换一张
取 消