Location: PHPKode > projects > PHPCrawl > PHPCrawl_080/documentation/classreferences/PHPCrawler/method_detail_tpl_method_addBasicAuthentication.htm


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<html>
<head>
 <title>Method Details</title>
 <link rel="stylesheet" type="text/css" media="screen" href="style.css">
 
 <script name="javascript">
 
 function show_hide_examples(mode)
 {
   if (document.getElementById("examples").style.display == "none")
   {
     document.getElementById("examples").style.display = "";
   }
   else
   {
     document.getElementById("examples").style.display = "none";
   }
 }
 </script>
 
</head>

<body>

<div id="outer">

<h1 id="head">
  <span>Method: 
PHPCrawler::addBasicAuthentication()</span>
</h1>

<h2 id="head">
 <span><a href="overview.html"><< Back to class-overview</a></span>
</h2>

<br>




<div id="section">

Adds a basic-authentication (username and password) to the list of basic authentications that will be send with requests.
</div>

<div id="section">
<b>Signature:</b>
<p id="signature">
  
public addBasicAuthentication($url_regex, $username, $password)
</p>
</div>

<div id="section">
<b>Parameters:</b>
<p>
<table id="param_list">
  
<tr><td id="paramname" width="1%"><b>$url_regex</b>&nbsp;</td><td width="1%"><i><i>string</i></i>&nbsp;</td><td width="*">Regular-expression defining the URL(s) the authentication should be send to.</td></tr><tr><td id="paramname" width="1%"><b>$username</b>&nbsp;</td><td width="1%"><i><i>string</i></i>&nbsp;</td><td width="*">The username</td></tr><tr><td id="paramname" width="1%"><b>$password</b>&nbsp;</td><td width="1%"><i><i>string</i></i>&nbsp;</td><td width="*">The password</td></tr>
</table>
</p>
</div>

<div id="section">
<b>Returns:</b>
<p>
<table id="param_list">
  
<tr> <td width="1%"><i><i>bool</i></i>&nbsp;</td> <td width="*"></td></tr>
</table>
</p>
</div>

<div id="section">
<b>Description:</b>
<p>

  
Example:<code>$crawler-&gt;addBasicAuthentication("#http://www\.foo\.com/protected_path/#", "myusername", "mypasswd");</code><br>This lets the crawler send the authentication "myusername/mypasswd" with every request for content placed<br>in the path "protected_path" on the host "www.foo.com".
  
</p>
</div>





</div>


<div id="footer">Docs created with <a href="http://phpclassview.cuab.de"  target="_parent">PhpClassView</a></div>
  
</body>
</html>
Return current item: PHPCrawl