I have an online photo album, and I don't necessarily want everyone to have access to my baby pics and me running around in my underwear when I was seven years old, so I want to password-protect the site. I have a good basic knowledge of building a site using DW-MX, but I admit that it's not very advanced. :>(( Does DW have a built-in ability to password-protect, or should I use something else?
I don't code HTML myself, but I think I could follow a tutorial as long as it's not too technical. I'm a bit hesitant that I'm going to bungle things in trying to implement a password, so I want to make sure I do this right.
Ideally I'd like to have a password field on my index/splash page, which one would need to pass in order to access any other sub-page. My host is GoDaddy, but I believe I've asked them about this possibility, and they just made suggestions for me - they didn't offer to do it themselves.
DW doesn't have a built in function per where you click and make passwords. You say you are using an online photo album. What script are you using for that? Many photo scripts allow you to password protect specific albums as you want. The first one that comes to mind is "Gallery" which is a PHP script if you are using a Godaddy plan with PHP and mySQL:
http://codex.gallery2.org/Downloads - Download link
http://gallery.menalto.com/ - Direct link to homepage which doesn't appear to be working for me at the moment.
What script am I using? I'm not sure I know what you're talking about. I created my own photo album online, where I place thumbnail photos in a table, then link them to the full-sized images. I have a splash page which leads to all the sub-sections of my site, and I'd like the splash/index page to have a password field.
If DW doesn't have a way to password-protect, how can this be done?
Does your goDaddy host support php? if so put a form similar to the one below on your index page i.e., asking for a 'password' and 'username'
<form action="password_protected.php" method="get">
<p>Username<br />
<input name="username" id="username" type="text" /></p>
<p>Password<br />
<input name="password" id="password" type="text" /></p>
<label for="button"></label>
<p><input type="submit" name="login" id="login" value="Login" />
</form></p>
Then create another page in DW and save it as password_protected.php. Open it in DW, go into code view and delete everything. Copy the below php code and paste it into the empty file and save it. Change the username and password from 'Pink', 'Elephant' to what you require and change the first url link from http://www.bbc.co.uk to that of the page you want protected and change http://www.itv.co.uk to that of the page you wish to send the user to if they do not supply the correct details.
<?php
$username = $_GET['username'];
$password = $_GET['password'];
if($username == "Pink" && $password == "Elephant") {
header("Location: http://www.bbc.co.uk"); }
else {
header("Location: http://www.itv.co.uk");
}
?>
North America
Europe, Middle East and Africa
Asia Pacific