Re: [PHP] Passing Credentials
On Mon, January 30, 2006 12:43 pm, News1 wrote: > I would prefer to have to log into my server and from there have these > credentials passed along to the web cameras. http://php.net/curl -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Passing Credentials
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 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
RE: [PHP] Passing Credentials
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: http://www.example.com";); curl_setopt($ch, CURLOPT_HEADER, 1); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC); curl_setopt($ch, CURLOPT_USERPWD, 'user:password') curl_exec($ch); curl_close($ch); ?> 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. Thanks! -Original Message- From: David Tulloh [mailto:[EMAIL PROTECTED] Sent: Monday, January 30, 2006 6:59 PM To: News1 Cc: php-general@lists.php.net Subject: Re: [PHP] Passing Credentials You want to use sessions, they allow you to store information such as login details between requests. Have a look at a simple tutorial, like this Zend one. http://www.zend.com/php/beginners/php101-10.php News1 wrote: > Rory, > > Thanks for the feedback -- I will try to be clearer. > > Yes, I want to login into a web page and from there get to another webpage. > > The webcams are on my network. I can access them directly; however, I would > like to create a page where several are visible at once. So, I would like > to be able to log into a "master" page, if you will, and from there be able > to access multiple webcam web pages from this "master" page. Right now I > can do it, but I have to authenticate for each webcam I access. Since I am > using authentication to access the "master" page, I would like to skip this > step for the webcams and be able to access them directly and automatically > pass the username/password credentials. > > Thanks again! I hope this is clearer. > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Passing Credentials
David Tulloh wrote: You want to use sessions, they allow you to store information such as login details between requests. Have a look at a simple tutorial, like this Zend one. http://www.zend.com/php/beginners/php101-10.php News1 wrote: Rory, Thanks for the feedback -- I will try to be clearer. Yes, I want to login into a web page and from there get to another webpage. The webcams are on my network. I can access them directly; however, I would like to create a page where several are visible at once. So, I would like to be able to log into a "master" page, if you will, and from there be able to access multiple webcam web pages from this "master" page. Right now I can do it, but I have to authenticate for each webcam I access. Since I am using authentication to access the "master" page, I would like to skip this step for the webcams and be able to access them directly and automatically pass the username/password credentials. Thanks again! I hope this is clearer. So every "webcam page" has its own authentication? Probably you should use fopen or fsockopen then. http://de.php.net/fopen http://de.php.net/fsockopen http://de.php.net/fputs http://de.php.net/fgets Probably somone can tell how to access HTTP auth sites with php? GET /pathto/webcam HTTP 1.0 Authantication: Basic and then? Password: ?? or what ^^ HTH and thanks if others can post the last info on how to auth via php. I also like to know that lol ^^ Greets Barry -- Smileys rule (cX.x)C --o(^_^o) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Passing Credentials
You want to use sessions, they allow you to store information such as login details between requests. Have a look at a simple tutorial, like this Zend one. http://www.zend.com/php/beginners/php101-10.php News1 wrote: > Rory, > > Thanks for the feedback -- I will try to be clearer. > > Yes, I want to login into a web page and from there get to another webpage. > > The webcams are on my network. I can access them directly; however, I would > like to create a page where several are visible at once. So, I would like > to be able to log into a "master" page, if you will, and from there be able > to access multiple webcam web pages from this "master" page. Right now I > can do it, but I have to authenticate for each webcam I access. Since I am > using authentication to access the "master" page, I would like to skip this > step for the webcams and be able to access them directly and automatically > pass the username/password credentials. > > Thanks again! I hope this is clearer. > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Passing Credentials
Sounds like a job for the Session system. On 1/30/06, News1 <[EMAIL PROTECTED]> wrote: > Rory, > > Thanks for the feedback -- I will try to be clearer. > > Yes, I want to login into a web page and from there get to another webpage. > > The webcams are on my network. I can access them directly; however, I would > like to create a page where several are visible at once. So, I would like > to be able to log into a "master" page, if you will, and from there be able > to access multiple webcam web pages from this "master" page. Right now I > can do it, but I have to authenticate for each webcam I access. Since I am > using authentication to access the "master" page, I would like to skip this > step for the webcams and be able to access them directly and automatically > pass the username/password credentials. > > Thanks again! I hope this is clearer. > > -Original Message- > From: Rory Browne [mailto:[EMAIL PROTECTED] > Sent: Monday, January 30, 2006 5:28 PM > To: News1 > Cc: php-general@lists.php.net > Subject: Re: [PHP] Passing Credentials > > You're still not being very clear. > > On 1/30/06, News1 <[EMAIL PROTECTED]> wrote: > > Hi. I asked a similar question last, week, but I don't think I asked it > > correctly. What I am trying to do is to web into a web server that I > > control (no problem here). > > Web into a web server? > > > However, from there, I want to be able to click > > a button on the web page and have multiple web cameras be displayed on my > > server's page (which I can do with frames, or some other method). The > issue > > I'm having is that I can't seem to pass the authentication credentials > > (username and password) along to the web cameras, > > Are the webcams accessed directly, or through yours, or someone elses site? > > > so each time I access them > > I have to supply the credentials. > > > > I would prefer to have to log into my server and from there have these > > credentials passed along to the web cameras. > > > > Any ideas on how to do this? > > > > Thanks! > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Passing Credentials
Rory, Thanks for the feedback -- I will try to be clearer. Yes, I want to login into a web page and from there get to another webpage. The webcams are on my network. I can access them directly; however, I would like to create a page where several are visible at once. So, I would like to be able to log into a "master" page, if you will, and from there be able to access multiple webcam web pages from this "master" page. Right now I can do it, but I have to authenticate for each webcam I access. Since I am using authentication to access the "master" page, I would like to skip this step for the webcams and be able to access them directly and automatically pass the username/password credentials. Thanks again! I hope this is clearer. -Original Message- From: Rory Browne [mailto:[EMAIL PROTECTED] Sent: Monday, January 30, 2006 5:28 PM To: News1 Cc: php-general@lists.php.net Subject: Re: [PHP] Passing Credentials You're still not being very clear. On 1/30/06, News1 <[EMAIL PROTECTED]> wrote: > Hi. I asked a similar question last, week, but I don't think I asked it > correctly. What I am trying to do is to web into a web server that I > control (no problem here). Web into a web server? > However, from there, I want to be able to click > a button on the web page and have multiple web cameras be displayed on my > server's page (which I can do with frames, or some other method). The issue > I'm having is that I can't seem to pass the authentication credentials > (username and password) along to the web cameras, Are the webcams accessed directly, or through yours, or someone elses site? > so each time I access them > I have to supply the credentials. > > I would prefer to have to log into my server and from there have these > credentials passed along to the web cameras. > > Any ideas on how to do this? > > Thanks! > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Passing Credentials
You're still not being very clear. On 1/30/06, News1 <[EMAIL PROTECTED]> wrote: > Hi. I asked a similar question last, week, but I don't think I asked it > correctly. What I am trying to do is to web into a web server that I > control (no problem here). Web into a web server? > However, from there, I want to be able to click > a button on the web page and have multiple web cameras be displayed on my > server's page (which I can do with frames, or some other method). The issue > I'm having is that I can't seem to pass the authentication credentials > (username and password) along to the web cameras, Are the webcams accessed directly, or through yours, or someone elses site? > so each time I access them > I have to supply the credentials. > > I would prefer to have to log into my server and from there have these > credentials passed along to the web cameras. > > Any ideas on how to do this? > > Thanks! > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Passing Credentials
Hi. I asked a similar question last, week, but I don't think I asked it correctly. What I am trying to do is to web into a web server that I control (no problem here). However, from there, I want to be able to click a button on the web page and have multiple web cameras be displayed on my server's page (which I can do with frames, or some other method). The issue I'm having is that I can't seem to pass the authentication credentials (username and password) along to the web cameras, so each time I access them I have to supply the credentials. I would prefer to have to log into my server and from there have these credentials passed along to the web cameras. Any ideas on how to do this? Thanks! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php