RE: Passing Credentials

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



News1 wrote:
> Thanks for all of the input!  I have tried a new tactic, using CURL.  I've
> had some success with grabbing a web page, but when I try to pass
> credentials, I get an error.  I tried following examples from various 
> sites (which all had different implementations), but I was unsuccessful.
>
>Here is the file I came up with:

1 <?php
2 $ch = curl_init();
3 curl_setopt($ch, CURLOPT_URL, "http://www.example.com";);
4 curl_setopt($ch, CURLOPT_HEADER, 1);
5 curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
6 curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
7 curl_setopt($ch, CURLOPT_USERPWD, 'user:password')
8 curl_exec($ch);
9 curl_close($ch);
10 ?>

> I get the following error:

> Parse error: parse error in /var/www/html/sess6.php on line 8

> If anyone has a suggestion, I would greatly appreciate it.

I've added line numbers to your code. Now look at the end of line 7. You
will see a missing ;. This is probably your parse error.

Albert

-- 
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.375 / Virus Database: 267.14.25/247 - Release Date: 2006/01/31
 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux