Password Protection #2

User 29283 Photo


Registered User
5 posts

I may have missed something! I need to password protect a website using Designer. Is it built in or does anyone know how to do that? Thanks, Bob Philo
User 187934 Photo


Senior Advisor
20,007 posts
Online Now

Hi Bob,
Which frame work are you using? I have a ready made login in SD Foundation.
I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.

This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com
User 2699991 Photo


Registered User
4,384 posts
Online Now

Do you mean the whole website in which case nobody can access it unless they know the password, in which case that can be done with your hosting service,

If you mean pages on your website then Eric's log in for people you choose to view a particular page(s) works beautifully, he did one for me recently, it's great thanks again Eric
Mastering The Understanding With Hands-On Learning
NEW TO
"COFFEECUP SITE DESIGNER" FOUNDATION 6 FRAMEWORK?
STUCK ON SOMETHING?

LEARNING & UNDERSTANDING "THE HOW TO"? THE WHY'S & THE WHEREFORE'S?
WITH WAYAN'S STEP BY STEP TUTORIALS

I can make "INDIVIDUAL BESPOKE" step-by-step video tutorials
for you to watch at your leisure as many times as you need

I have also started updating the ready made step by step tutorials, Ready Soon

my secure email details form
https://rsd-tutorialscom.coffeecup.com/ … l-details/
User 187934 Photo


Senior Advisor
20,007 posts
Online Now

Thanks Wayan. I added a to many login attempts feature to it. Here's the most recent version.
Latest working here. This setup allows only the members listed to get access. Specific content and redirects can be added.
https://ericrohloff.com/coffeecup/ccfor … /login.php
The only thing that has to be done is to paste the code below to the very top of the login.php and, main.php after export.
<?php
session_start();
ob_start();
?>

The users and their passwords are manually added to the code in the login.php within SD.
usernames passwords
one 11111
two 22222
three 33333

To protect content you put his code above the content to be protected in SD.
<?php
if(isset($_SESSION['username']) || isset($_COOKIE['username'])){
?>

Then you put this code after the content to be protected in SD.
<?php
}
else { header("Location: login.php");
exit();
}
?>

If you want a user level type login system I can tweak it to meet that need.
If you want to send users to their own page I can tweak it for that.
SD file here https://ericrohloff.com/coffeecup/ccforum/site-designer/login-form/login-form.zip
Attachments:
I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.

This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com
User 2699991 Photo


Registered User
4,384 posts
Online Now

Eric
If you want to send users to their own page I can tweak it for that.

that option is indeed of great interest for me/
Mastering The Understanding With Hands-On Learning
NEW TO
"COFFEECUP SITE DESIGNER" FOUNDATION 6 FRAMEWORK?
STUCK ON SOMETHING?

LEARNING & UNDERSTANDING "THE HOW TO"? THE WHY'S & THE WHEREFORE'S?
WITH WAYAN'S STEP BY STEP TUTORIALS

I can make "INDIVIDUAL BESPOKE" step-by-step video tutorials
for you to watch at your leisure as many times as you need

I have also started updating the ready made step by step tutorials, Ready Soon

my secure email details form
https://rsd-tutorialscom.coffeecup.com/ … l-details/
User 187934 Photo


Senior Advisor
20,007 posts
Online Now


Ver 2 working here. This setup allows only the members listed to get specific content and pages.
https://ericrohloff.com/coffeecup/ccfor … /login.php
The only thing that has to be done is to paste the code below to the very top of the login.php and, one.php, two.php, three.php after export.
<?php
session_start();
ob_start();
?>

The users and their passwords are manually added to the code in the login.php within SD.
usernames passwords
one 11111
two 22222
three 33333

To protect content you put his code above the content to be protected in SD. Adjust the $_SESSSION and $_COOKIE to the users data that you used in the login.php
<?php
if((isset($_SESSION['username']) && $_SESSION['username'] == 'one') || (isset($_COOKIE['username']) && $_COOKIE['username']=='one')){
?>

Then you put this code after the content to be protected in SD.
<?php
}
else { header("Location: login.php");
exit();
}
?>
Attachments:
I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.

This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com
User 2699991 Photo


Registered User
4,384 posts
Online Now

Hi Everybody
I just want to say, that this is just great, and a big THANK YOU to Eric the PHP Master Guru
It works great on two of my websites now and can be really made to look awesome using the magnificent magical power of 'Site Designer' (I used Foundation framework, but see no reason why it can't be done on any of the other frameworks (including the pesky frameworkless :D) 'Site Designer makes customising/styling the pages a breeze.

It's fairly easy to set up using the code from Eric I am a real novice when it comes to PHP but with help and guidance I eventually sort of mastered it and began to understand what was going on and what was needed.

Anyone wanting a simple easy to implement login form, using just 'Site Designer' elements and styling them need
look no further.
Thanks again Eric Nice one.
Mastering The Understanding With Hands-On Learning
NEW TO
"COFFEECUP SITE DESIGNER" FOUNDATION 6 FRAMEWORK?
STUCK ON SOMETHING?

LEARNING & UNDERSTANDING "THE HOW TO"? THE WHY'S & THE WHEREFORE'S?
WITH WAYAN'S STEP BY STEP TUTORIALS

I can make "INDIVIDUAL BESPOKE" step-by-step video tutorials
for you to watch at your leisure as many times as you need

I have also started updating the ready made step by step tutorials, Ready Soon

my secure email details form
https://rsd-tutorialscom.coffeecup.com/ … l-details/

Have something to add? We’d love to hear it!
You must have an account to participate. Please Sign In Here, then join the conversation.