
I'm a website developer (mostly HTML and CSS, and a tad bit of PHP - can read but not write). I have a development subdomain for my main site. It can be found at dev.mochajavascript.com. If you take a look at that page, you'll see I'm trying out setting up single passwords for each project I'm working on. The idea is to hand my clients their own password, and it only works for that particular project.
I'm not looking for anything super secure. I'm looking more for a simple log-in. One of my ex-coworkers had this on his splash pages for any site he was working on, and I liked the concept.
I've got majority of the code worked out, but for the life of me I can't get it to recognize the correct passwords. No matter what I do, it keeps bouncing the error back at me. Can someone take a look at these codes and tell me what I'm doing wrong? It's got to be something simple...
/scripts/view.php
- Code: Select all
<?php
$WPStyles = "http://dev.mochajavascript.com/WP-Styles/";
$BP = "http://dev.mochajavascript.com/BP-2.0.9/phpBB3/";
$Harwell = "http://dev.mochajavascript.com/Harwell/";
$oops = "http://dev.mochajavascript.com/wrongpassword.html";
$passWP = $_POST['WP'];
$passBP = $_POST['BP'];
$passHarwell = $_POST['Harwell'];
if($passWP == "opensaysme"){
echo"<html><head><meta http-equiv=\"refresh\"content=\"1;url=$WPStyles\"></head></html>";
}
if($passBP == "seedling"){
echo"<html><head><meta http-equiv=\"refresh\"content=\"1;url=$BP\"></head></html>";
}
if($passHarwell == "congressionalvalue"){
echo"<html><head><meta http-equiv=\"refresh\"content=\"1;url=$Harwell\"></head></html>";
}
else{echo"<html><head><meta http-equiv=\"refresh\"content=\"1;url=$oops\"></head></html>";}
?>
index.html
- Code: Select all
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>MochaJava Site Development</title>
<link rel="stylesheet" type="text/css" href="/scripts/nice.css"/>
</head>
<body>
<h1>What's Chrissie Doing Now?</h1>
<div class="this">
<p>NO PEEKING! (unless I says you can...)</p>
<center>
<form name="form" method="post" action="/scripts/view.php">
<table border="0" cell-padding:"5px">
<!-- MAKE SURE TO UPDATE view.php! -->
<tr>
<td style="text-align: right; padding-right: 10px; color:#F60;">Word Press Styles</td>
<td>Password: <input type="password" name="WP" />
<input type="submit" value="Submit" /></td>
</tr>
<tr>
<td style="text-align: right; padding-right: 10px; color:#F60;">BP Development</td>
<td>Password: <input type="password" name="BP" />
<input type="submit" value="Submit" /></td>
</tr>
<tr>
<td style="text-align: right; padding-right: 10px; color:#F60;">Harwell Site</td>
<td>Password: <input type="password" name="Harwell" />
<input type="submit" value="Submit" /></td>
</tr>
</table>
</form>
</center>
</div>
<div class="feet" style="text-align:center"><a href="http://www.MochaJavaScript.com">www.MochaJavaScript.com</a></div>
</body>
</html>





Google searches are amazing - IF you use the right terms 



I'm not self hosted, and I'm running a Mac to boot. I'm hosted through hostmonster.com and have all my client's websites under my "main" website though it doesn't read that way from the browser. I might be missing something in your instructions, but I've never had a "host" send me any files for my computer - unless you're talking about through Xamp?