0

I'm having to re-create existing code in php.

A perl script which implements FCGI::Request() is connected to via LWP::UserAgent->credentials()

How would I connect to this script using cUrl (php) instead of LWP (perl)?
Or, What is a better/more suited method of connection to such from php?

Simon.
  • 1,886
  • 5
  • 29
  • 62

1 Answers1

1
curl_setopt($ch, CURLOPT_USERPWD, urlencode($username) . ':' . urlencode($password));

Where $ch is $ch = curl_init(); Rest are self explanatory.

Also see: How do I make a request using HTTP basic authentication with PHP curl? and Client URL Library.

Community
  • 1
  • 1
Chankey Pathak
  • 21,187
  • 12
  • 85
  • 133