Hello - after taking long while off from web developing I am finding it hard to get back on track.

I need to update one of my web pages with a "secure" area that requires a "login" to access it. It doesn't require anything more than one username and one password for all users as they will all use the same username and password.

Is this simple to accomplish? Is it possible with HTML? I am currently using Dreamweaver MX.

Any help or guidance would be appreciated.

TIA

Ed

Dani AI

Generated

Ed () needs a single shared username/password to gate a simple page. Dreamweaver MX is only an HTML editor — the protection has to come from the web server or server-side code. As observed, a JavaScript-only “login” is not secure; as noted, the realistic options are either server-level protection or a small server-side login system.

Two practical approaches with different tradeoffs:

  • Server-level (fastest): use Apache HTTP authentication with a .htaccess/.htpasswd pair. No programming is required and it works immediately, but the browser shows a native login prompt and credentials are only safe when sent over TLS. See the Apache authentication how-to and htpasswd tool for details (Apache HTTP Server: Authentication, htpasswd program).
  • Server-side (more flexible): implement a tiny login flow (HTML form -> POST -> server script) that verifies a hashed password, then sets a session cookie to protect pages. This gives control over the UI and logout behavior; use strong hashing and the language’s secure session features (for PHP, see password_hash/password_verify and session handling). Regenerate session IDs and set secure/HttpOnly flags.

Security notes: never store plaintext credentials in public files, avoid client-side protection, and always run the protected area over HTTPS (free certificates via Let’s Encrypt). For very small needs on shared hosting, the host control panel’s “password protect directory” is often the easiest route.

Recommended Answers

All 6 Replies

I guess simplicity depends on how secure you want it. More secure will make it more complex.

Using html & javascript should enable you to create a simple login system, BUT it is not going to be very secure.

I guess simplicity depends on how secure you want it. More secure will make it more complex.

Using html & javascript should enable you to create a simple login system, BUT it is not going to be very secure.

Hmmmm doesn't sound very good does it? So how would I make a secure area on my website so that only certain people who have the password could access?

Thanks again

Ed

Again, it depends on what you mean by secure. At the simplest level, you could have javascript which will read a simple login form. I don't advise this because it isn't really secure.

At the other end of the scale, you will be looking at some server-side language with access to a database, which could be overkill and a big learning curve.

What content are we talking about?

I would like to add a link off of my main page to give access to a simple webpage with pictures and text to people that I give the password to.

Thanks again

Ed

JavaScript is a crap idea, anyone can see the code by clicking view -> source and therefore access the area. Also, what about people whose browsers dont support it?

If you have access to serverside technologies like PHP or ASP, they are a much more secure way to do it. An HTML form posts input to a handler written in the serverside language which validates it, against a database if need be.

If you dont support that, you may be able to use a thing called .htaccess if you have an apache web server

lol, just to clear things up I don't think JavaScript is a good idea :p

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.