[Pro] Adding Password Protection Script

I’ve found this script (which I think others here might have used) but, I’m not sure how to implement this into a Freeway site.

In order to use it, the pages must be .php (the instructions say to just change .html to .php) and I’m not sure how or where to add the code needed to protect the page.

If anyone has any experience with this, I would appreciate it.

Thanks.

Bob


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

What is “this” script, Robert? Has it a name? Have you an URL to the script web site?

Often these things ar done by adding markup to the page, or by adding code into, say, the of the document (via html markup in Freeway).

But we need to know more about ‘the’ script !

Hugh


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Ah…forgot the link! Sorry…


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

It seems fairy simple. How much do you or don’t you understand?

Basically, if you’ve folloed the instructions and put your password-prtect.php file on the site alongside your other files, you need to do two things.

  1. rename the page your protecting to a .php extension - do this in the inspector.

  2. add the markup … <?php include("/home/haveahobby/htdocs/protector/password_protect.php"); ?>… to the very start of your document. Do this through the Page - HTML Markup in Freeway and add this code in the ‘before HTML’ section

  3. Save your file and upload it. make sure you have the script file on the server, too, and it should work.

You do need to ensure your paths are correct in the snippet you add to your page. They show a relative path, although maybe an absolute path would work, i don’t know, eg. http://www.yoursite.com/foldermaybe/protector.php

Any clearer?


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Thanks, Hugh, I’ll give that a shot.


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

I just tried it and it was simplicity itself - worked for me first time.

IF…you put the password-protect.php script in amongst your other page files on the server, then all you need as the code at the top of the page is…<?php include("password-protect.php"); ?>

In fact I renamed password-protect.php to protect.php, so my include was a simple <?php include("protect.php"); ?>

But remember, this include code MUST be right at the start of the page, before any HTML code…ok?

Bob’s Your Uncle (pardon the pun…!)


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Where does the page “give me” that code that I’m supposed to type in my pages?

If I go to the protect.php I get the username/password page. Where is the code I’m supposed to use?

Bob


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

If you go to protect.php you shouldn’t even get the username/password page…something wrong there.

However, got to:

www.yourwebsite/protect.php?help

and it will give you the code. Note the ‘?help’ suffix - you must add this to the address. The you get a few lines with a line of code which you can copy to add to your pages.

OK?


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

OK. I got the code (even typed in your code), but it keeps coming up Password Incorrect even if I use the ones that came with the page.

Any ideas?


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

If it’s coming up with password incorrect…then the script is working (it’s responding to you). So that’s good.

But you probably have got your username/password incorrect. What are you using?

If you want to, send me your script file (protect.php or whatever you’ve called it)

to: email@hidden

I’ll take a look


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

OK. I discovered I put the username and sample name in the example section rather than where it was supposed to go!!

So, I fixed that and re-uploaded the protect.php, added the code to the protected page, but now it goes right to the page without asking for a username and password.

Bob


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

ah it’s hiding my email address!!

send it here if you can work it out!..

bruzzable

at

the usual hot place

com


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

That will probably happen because you are ‘in session’ with your browser.

Quit your browser, try again and it will probably ask you for the code.

See what happens anyway.


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Eureka! It works!

Can you tell I have NO coding experience whatsoever if I can’t even do a simple job like this??

Thanks very much for walking me *very slowly) through this.

Your help is much appreciated!

Bob


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

No problem, glad it’s working.

The first steps were daunting for me, too…!!


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Hugh, I hope you’re still listening, because I have one more question…

I can’t figure out how to customize the page with the login fields. I’d like to have that page look like the rest of the site, but haven’t been able to figure it out.

Here’s where they tell you how to do it:

But, I can’t figure it out. Not sure exactly what code I’m copying or what page it goes on, or, well…any of it!

I’ve posted in their forum, but it seems pretty dead over there.

Thanks…

Bob


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options