Page 1 of 1

need help with password code again...

Posted: Sat Jan 21, 2006 3:39 pm
by nickman013
Hey, I need help with a password code that I got help with prior to this.

The code now is fine, but I need it to make the links, include stuff in that page. When it is clicked.

Code: Select all

<? 
function showForm() { 
echo "<form method=post action=/pages/login.php><br>admin id# :<br> <input type=password name=pw><br /> 
<input type=submit> 
</form>"; 
} 

$content = "<html><font size=7> 
<p><p>
<a href=/visit_log.htm>Stats</a><br> 
<a href=/pages/muotreport/add394958.php>Make Muot Report Code</a><br> 
</font></html><br>
<br> 
<a href=/pages/muotreport/add39495899.php>Add Muot Report Code</a><br> 
</font></html>";
$wrong = "<html><font size=-1 color=red><b>THE PASSWORD YOU ENTERED IS INCORRECT</b></font></html>"; 
//check if something was entered into field 
if(!empty($HTTP_POST_VARS['pw'])) { 
if($HTTP_POST_VARS['pw'] == 'MYPASSWORD') { 
echo $content;
} 
else { 
showForm(); 
echo $wrong; 
} 
} 
else { 
showForm(); 
}
?>
I just need the HTML links to go away when a link is clicked and view different data.

Thank You

Posted: Sun Jan 22, 2006 8:20 am
by nickman013
or multiple passwords... i am probably going to get rid of this script and just go with a MYSQL database for the username & password.

does anybody have a link they can point me to so i can have a login page, and then it goes to a users only page. but if someone who is not a admin trys to go to the URL, it will make them login... thank you