I'm doing some freelance work for a photography studio.
They're doing the senior portraits for a couple schools in the are.
They had a cool idea. They wanted to put together slideshows of every student to put online.
The problem, however, is they want them password protected.
EVERY ONE of them.
So, I did some playing around.
This is what I came up with:
now, for each video, I have the page set up as so:PHP Code:<?php
$username = "someuser";
$password = "somepassword";
if ($_POST['txtUsername'] != $username || $_POST['txtPassword'] != $password) {
?>
<h1>Login</h1>
<form name="form" method="post" action="<?=$_SERVER['PHP_SELF']; ?>">
<p><label for="txtUsername">Username:</label>
<br /><input type="text" title="Enter your Username" name="txtUsername" /></p>
<p><label for="txtpassword">Password:</label>
<br /><input type="password" title="Enter your password" name="txtPassword" /></p>
<p><input type="submit" name="Submit" value="Login" /></p>
</form>
<?php
}
else {
?>
<p>This is the protected page. Your private content goes here.</p>
<?php
}
?>
index.php has this:
Then, videos.php:PHP Code:if(@$_GET['name']) {
$name = $_GET['name'];
include('videos.php');}
else{
//index.php html
}
etc, etc, etc.PHP Code:if ( $name == "whatever") { //video for whatever }
elseif ( $name == "whoever") { //video for whoever }
now, I want each of these videos password protected.
I really DO NOT want to use the above script for over 300 some people!
Any ideas on how to do this?
[without .htaccess? I'm also not sure id msql is supported on their server, either]



Reply With Quote

Bookmarks