[PHP] authentication
I have a question that maybe someone could answer. If you by chance come across a secure area that prompts the username and passcode to a folder, how I can PHP to automagically add them in later on? Also, instead of that dialogue popping up, is there a way you can "add" your own via HTML form and then subit those values to the dialogue or calling proc? Just a few questions as I am even researching this now. Thanks in advanced! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] authentication
Sorry about that. What I meant was for example, sometimes I come across protected sites that require a username and passcode. So, if one was to protect a directory or folder, a regular dialog will appear for username and passcode prompt within the web browser. I was researching some variables that I came across which is called $PHP_AUTH_USER, $PHP_AUTH_PW, and $PHP_AUTH_TYPE. At my location, on the network, when I reached a protected folder, I always have to enter the username and passcode within the browser (because its actually acessing an actual directory to list out). However, I would like to by pass that by a user entering the username and passcode via HTML, instead of the dialog showing. I hope that helps a little. Thanks "Chris Shiflett" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > --- Chris Winters <[EMAIL PROTECTED]> wrote: > > If you by chance come across a secure area that prompts > > the username and passcode to a folder > > Can you rephrase that? I can't tell what you are talking > about. Does a separate window pop up prompting for a > username and password, or is this part of the Web page in > your browser? > > Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] authentication
Chris, Exactly. I am relying on the webserver to provide the restrictions. Now my next question: what functions should I utilize or come close to to do it? There isnt any PHP pages directed towards teh directory itself. Its is just a hard link to the protected areas. Are there any functions that support it? Im googling now ;) Thanks for your answers in advanced and previously. Chris "Chris Shiflett" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > --- Chris Winters <[EMAIL PROTECTED]> wrote: > > So, if one was to protect a directory or folder, a > > regular dialog will appear for username and passcode > > prompt within the web browser. I was researching some > > variables that I came across which is called > > $PHP_AUTH_USER, $PHP_AUTH_PW, and $PHP_AUTH_TYPE. > > Yes, these variables deal with HTTP basic authentication. > > > I would like to by pass that by a user entering the > > username and passcode via HTML, instead of the dialog > > showing. > > In that case, you will want to do exactly as you say, > collect the username and password via an HTML form and > authenticate the credentials with PHP. It sounds like you > are currently relying on your Web server to provide the > access restrictions. > > So, you can either: > > 1. Keep HTTP basic authentication enabled in the Web server > for these directories and live with the behavior. > 2. Turn off HTTP basic authentication in the Web server and > write a login page in PHP. It is then up to you to control > access to whatever resources you want to protect, so this > will require a bit of work on your part. > > Hope that helps. > > Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] php headers already sent error.
Im SO CLOSE! Welll to start I had everything running FINE (MySQL, Apache, and PHP) until I installed STUPID Zend Studio for PHP. After their 30 day trial expired, I uninstalled it and everything just went downhill. After re installing everything, I have these errors left over. Now the code is already on production server running (but with Linux). Im on a win2K box (dont laugh)- BUT before it worked. I have no idea what this means since Im new to apache and PHP installs. Thanks for any help in for what to check Notice: Constant false already defined in c:\www\html\defines.php on line 4 Notice: Constant true already defined in c:\www\html\defines.php on line 5 Warning: Cannot add header information - headers already sent by (output started at c:\www\html\defines.php:4) in c:\www\html\index.php on line 9 Warning: Cannot send session cookie - headers already sent by (output started at c:\www\html\defines.php:4) in c:\www\html\index.php on line 89 Warning: Cannot send session cache limiter - headers already sent (output started at c:\www\html\defines.php:4) in c:\www\html\index.php on line 89 Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] replace string in array
I'm having a bit of trouble... I have an array that consists of a string like this: string1\rstring2\rstring3\rstring4 I want to REMOVE STRING3, and keep the rest of the array intact - but cannot figure on how to do it. I tried using functions such as preg_replace, strstr and so forth... In my code this is how I go thru the array... //snippet... //search for carriage return, split it... $line = preg_split( "/[\r]+/" ,$line); reset($line); //Line will consists of array... while (list ($key, $val) = each ($line)) { echo "$key => $val"; if(strstr($val,$newmail)) { echo "Found! and trying to delete"; //What to do form this point, I have the slightest foggy... } } It finds it without ANY problems, but I cannot seem to "go" to the position of found string, delete it, then keep the rest of the array. I did manage to find this on php.net, but it doesnt seem to work: function stri_replace2 ($search,$replace,$text) { if (!is_array($search)) { $search = array($search); $replace = array($replace); } foreach($search AS $key => $val) { $search["$key"] = '/'.quotemeta($val).'/i'; } echo "$search $replace $text"; return preg_replace($search,$replace,$text); } Could anyone help me with this? Thanks in advanced! Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php