Hallo, möchte gerne eine zweite Homepage machen, aber die ist dann absolut privat und soll passwortgeschützt sein:
habe folgenden PHP-Script gesichtet, wo man dachte, der könnte einfach sein. Weil ich will auch nur 2-3 User anlegen bzw. 2-3 Passworte.
Tja, hab die PHP Datei hochgeladen, so wie hier in der Anleitung steht:
und bekomme dann folgenden Code
ZitatAlles anzeigen<And>
<html>
<head>
<title>Login to access this page</title>
<META>
<META>
<style>
* {
font-family:Verdana;
font-size:12px;
}
a {
color: #000000;
text-decoration: none;
}a:hover {
color: red;
text-decoration: none;
}input {
border: 1px solid black;
background-color: #FFFFFF;
}
.bodyform {
border-color: #000000;
border-style:solid;
border-width: 3px;
width:400px;
}
.title {
color: #FFFFFF;
background: #000000;
padding: 5px;}
</style>
</head>
<body>
<center><br><br>
<div>
<form>
<div>
<strong>Access restricted - Login Below:</strong></div>
<div>
<font><strong><strong></font><br><br>
<table>
<tr>
<td>Login:</td>
<td><input></td>
</tr>
<tr>
<td>Password:</td><td><input></td>
</tr>
</table>
<p></p>
<input>
</form></div>
</div>
<br>
Powered by <a href="http://savasplace.com" target="_blank">Sava's Place Password Protect Script</a>
</center>
<script></script></body>
</html>
ZitatUse of Script
* Upload password.php to your website
* Open up password.php?code from your browser to learn how to include this file
* Enter the code that appears on every page you want to be protected. It should be best to enter the code at the very first line of your pagesThank you for using Password Protect from Sava's Place.com.
Also nochmal, hochgeladen ist es, aber wie was muss ich jetzt includen? dachte ich werd was wichtiges sehen .... sehe aber nicht durch. Danach kommt ne leere Seite, wie definiere ich es?
Und warum kann ich "SUBMIT" nicht übersetzen?
Das ist der PHP Code:
ZitatAlles anzeigen<?php
##################################################################
## Sava's Place.com Password Protect ##
## Visit http://savasplace.com for more scripts ##
##################################################################
$LOGIN_INFORMATION = array(
'sava' => 'sava',
'you' => 'yourpassword'
);// Require username or not
// If you want to use username and password login leave this true.
// If you want only to request a password set it for false.define('USE_USERNAME', true);
// To password protect your pages you need to include this file in them
// To get the correct code for inclusion open password.php?code in your broswerif(isset($_GET['code'])) {
die('<center><font>Include following code into every page you would like to protect, at the very beginning (first line):<br><br><strong><?php include("' . __FILE__ . '"); ?></strong></center></font>');
}
if(isset($_GET['logout'])) {
setcookie("verify", ''); // clear password;
die('<center><font>Logged out.</font></center>');
}
if(!function_exists('showLoginPasswordProtect')) {
function showLoginPasswordProtect($error_msg) {
?>
<And><html>
<head>
<title>Login to access this page</title>
<META>
<META>
<style>
* {
font-family:Verdana;
font-size:12px;
}
a {
color: #000000;
text-decoration: none;
}a:hover {
color: red;
text-decoration: none;
}input {
border: 1px solid black;
background-color: #FFFFFF;
}
.bodyform {
border-color: #000000;
border-style:solid;
border-width: 3px;
width:400px;
}
.title {
color: #FFFFFF;
background: #000000;
padding: 5px;}
</style>
</head>
<body>
<center><br><br>
<div>
<form>
<div>
<strong>Access restricted - Login Below:</strong>
</div>
<div>
<font><strong><php><strong></font><br><br>
</td>
<td><input></td>
</tr>
</table>
<p></p>
<input>
</form>
</div>
</div>
<br>
Powered by <a href="http://savasplace.com" target="_blank">Sava's Place Password Protect Script</a>
</center>
</body>
</html>
<php>$val) {
if ($_COOKIE['verify'] == md5($val)) {
$found = true;
break;
}
}
if (!$found) {
showLoginPasswordProtect("");
}
}
?>