Password Protection example

Started by zubrag, December 14, 2006, 05:03:22 PM

alexrox127

On my page i want to password protect i put in the code the script provided me with and it says "Warning: include(public_html/admin/password_protect.php) [function.include]: failed to open stream: No such file or directory in /home/a7539236/public_html/admin/index.php on line 1"

"Warning: include(public_html/admin/password_protect.php) [function.include]: failed to open stream: No such file or directory in /home/a7539236/public_html/admin/index.php on line 1"

"Warning: include() [function.include]: Failed opening 'public_html/admin/password_protect.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/a7539236/public_html/admin/index.php on line 1"

What do i do?

kws

Hi, great script. Think i have it working ok.

But can i get the form for the login details to appear on my site.
Basically i want to put that section of code on one of my template pages so it looks the same as the rest of my site.

Can anyone help with this, Thanks.

kws

Hi, ive got the script up and running with my website background but now im having a problem with the log in, everytime i go to a new page it keeps requests the log in.

I have no time out currently set so i dont see why this should happen.
Can you help me out please. Thanks

kws

Ok Never mind my last 2 posts ive, managed to figure it out and as a far as i can tell i have everything up and running.
Although the support wasnt great i cant complain as the code is really handy.
Thanks for the .php code.

annann

Thanks for the scripts. It works. And it's easier than I thought!
I just have one more question. Is there anyway I can track who have been logged in? (by the users name I have assigned to them).
Please advise.  Thanks so much! =)

zoipes

I uploaded the password protect script. The passwords provided do not work. After I type them in, I get "incorect password". Any idea what is wrong?

bellskees

Hi There,

I am trying to protect a page or pages (html) on a website.
I do not use php & am not familiar with it.

Can someone tell me what I need to do to password protect pages?

Do I need to install PHP?

Many thanks,
???

dgow

I am also having the same problen as jenmca.  I followed the instructions... then put a link on one of my pages to the secure page. When I click on the link to go to the secure page i get the login page just like i am suppose to. After inputting the id & password it takes me to my secure page.  BUT, if I type the url of the secure page directly into the address bar then the secure page comes up with out any login to get to it. Not really secure to me.  Any suggestions?

Lyle

Is there a way for users to change their own password? 

Is there a way to issue a user a temporary password and then they set their own?



recoding


Is there a way for users to change their own password? 

Is there a way to issue a user a temporary password and then they set their own?



Offhand no, you would need a fully featured content management system for that kind of thing, you would need levels so that you as the admin could remove/change passwords, and users could only change their own..when you start thinking like that its complicated.

recoding


I have carefully followed all the instructions on how to get the password protect script working but when I enter the address of the protected page it comes right up, the password is not required to see the page.  Could I be missing something? I put the password_protect.php file on my server, changed the username and password and added the line of code needed to protect the page to the very first line like required. Any ideas?

Jennifer

I am also having the same problen as jenmca.  I followed the instructions... then put a link on one of my pages to the secure page. When I click on the link to go to the secure page i get the login page just like i am suppose to. After inputting the id & password it takes me to my secure page.  BUT, if I type the url of the secure page directly into the address bar then the secure page comes up with out any login to get to it. Not really secure to me.  Any suggestions?

Hey you two (:

Basically, once you've logged in once, your logged in until you close your browser/ a hour...this works whatever way you go to the website..

Basically once you've logged in its like you actually have the keys to the house, not just been let in the door, you have access to the pages for a period of time, not just for that one time you logged in. I hope this helps.

stevo

Can anyone help me with a problem I'm having getting the script to work?

I've used it on one site with no problems (and it's brilliant!) but when I try the same code on another site (different server) I get the following message at the top of my protected page:

Warning: Cannot modify header information - headers already sent ... in password_protect.php on line 137

...and after that, any action I try and do on the page keeps sending me back to the login screen.

Can anyone help? I'm really struggling to figure out what's happening!

Steven

recoding

You need to have <?php include 'password_protect.php'; ?> at the VERY top, if there is even one space, or one blank line it wont work.

ostatni

And I get:
Parse error: parse error in C:\inetpub\wwwroot\Password\password_protect.php on line 116

even if i do not touch to password_protect.php file
and cannot go anyfurther..
could somebody help