Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Recommended Posts

Posted (edited)

I found this protection script, not as secure as fort knox but works good. my problem was that my host control panel is windows, and when I added password protection to my admin panel, all of the files and directory's in the admin area were changed to modified attributes, this in turn would bring up errors when I would try to view my admin panel. here is the coding I found to protect the admin panel, the area to protect would be the admin/index.php.

 

 

<html>

 

<head>

<title>password protection test</title>

</head>

 

<body>

<?php

 

// Define your username and password

$username = "user";

$password = "password";

 

if ($_POST['txtUsername'] != $username || $_POST['txtPassword'] != $password) {

 

?>

<p>

<b>Login</b>

</p>

<form name="form" method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>">

<div align="center">

<center>

<table border="0" cellpadding="5" cellspacing="0">

<tr>

<td><label for="txtUsername">Username</label>

</td>

<td><input type="text" title="Enter your Username" name="txtUsername" /></td>

</tr>

<tr>

<td><label for="txtpassword">Password</label>

</td>

<td><input type="password" title="Enter your password" name="txtPassword" /></td>

</tr>

</table>

</center>

</div>

<p align="center"><input type="submit" name="Submit" value="Login" /></p>

</form>

 

<?php

}

else {

?>

 

<p>This is the protected page. Place your entire content of the page to be protected in this area.</p>

 

<?php

}

?>

 

</body>

 

</html>

 

I found this at ThinkHost

Edited by Blackjack

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...