Forum Moderators: coopster

Message Too Old, No Replies

Sending Command to CGI File Behind Username and Password

How to do this without logging in.

         

wfernley

7:40 pm on Apr 26, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hey everyone,

Alright, this is going to be a tough one to do....hopefully you guys can help me figure out a solution.

I have a network camera which is similar to a webcam. It has a cgi file behind a username and password which you send commands to that tell the camera to pan/tilt or zoom.

I would like to create a script that moves the camera when you click a link. The problem is when you click the link it asks for a username and password. Is there anyway I can assign this information before hand so it bypasses the login details.

Once I login, I can send all the commands I want but its the initial login that I want to get rid of. Is there a way I can specify the username and password in a php header? Does anyone know of a solution around this?

I know the username and password, I just want people wanting to control the camera to be able to do so without having the enter a username and password. The authentication is a basic serverside authentication.

Can anyone help?

Thanks!

Wes

sned

9:58 pm on Apr 26, 2007 (gmt 0)

10+ Year Member



Is it asking for a .htaccess style user/pass?

I think in that case you might be able to do something like:

<a href="http://user:pass@www.example.com/cgi-bin/yourfile">Pan Left</a>

not that it's a good idea ... (pass in clear text)

-sned

[edited by: dreamcatcher at 10:40 pm (utc) on April 26, 2007]
[edit reason] Use example.com, thanks. [/edit]

wfernley

1:14 pm on Apr 27, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Unfortunately, most browsers do not allow that now so I have to find a back way of doing it.

jatar_k

1:34 pm on Apr 27, 2007 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



if it is apache auth then maybe this will help
[php.net...]