Forum Webmastera, HTML, CSS, PHP, MySQL, Hosting, Domeny - Forum dla Webmasterów
hasło na strone - Wersja do druku

+- Forum Webmastera, HTML, CSS, PHP, MySQL, Hosting, Domeny - Forum dla Webmasterów (https://www.webmastertalk.pl)
+-- Dział: Technologie internetowe - tworzenie stron WWW (https://www.webmastertalk.pl/forum-technologie-internetowe-tworzenie-stron-www)
+--- Dział: Początkujący webmaster (https://www.webmastertalk.pl/forum-poczatkujacy-webmaster)
+--- Wątek: hasło na strone (/thread-haslo-na-strone)

Strony: 1 2


hasło na strone - alabruda77 - 01-07-2009

Witam czytałem na ten temat naprawdę dużo postów ale nie znalazłem pomocy więc pisze. Bo chciałem zrobić hasło na podstronę w mojej stronie. Znalazłem skrypt ale nie umie go skonfigurować nie jest on może bezpieczny ale to zawsze cos. o to on jest tam cos w ramach Head i body ale nie wiem gdzie to umieścić na stronie która chce chronić hasłem??
Kod:
W ramach HEAD

<!--
Created by Greg Boyd on July 30, 1997
To use this teleport/password feature as I call it, all you need to do
is cut and paste the entire code including what you are reading.  
The file takes what you put in the box and takes you to the page of that name.  
It is easier to use if you include a list of the sites on your pages.
If you have problems getting this to work, email me at [email protected] .
-->

<script Language="JavaScript">
// Greg Boyd;   [email protected]   URL:   http://www.frontiernet.net/~mims/
// Password Java Script (v1.0);  
// Please honor my hard work, if you use a variant of this in your page, then
// please email me :) and keep the above comments in the Script.
//
//   This code is Copyright (c) 1997 Greg Boyd,
//   all rights reserved. In order to receive the right to license this
//   code for use on your site the original code must be copied from the
//   Web site http://www.frontiernet.net/~mims/. License is granted touser to
//   reuse this code on their own Web site if and only if this entire copyright
//   notice is included. Code written by Greg Boyd of http://www.frontiernet.net/~mims/.

function password (pass)  {

var password = ''


if (password != null){
        location.href= pass + ".htm";
}
}
</script>

W ramach BODY

Hasło
<FORM name="login">
<INPUT NAME="pass"><br><br>
<INPUT TYPE="button" VALUE="Kliknij" onClick="password(form.pass.value)">
<INPUT TYPE="RESET" VALUE="Wyczyść">
</form>
A oto fragment mojej stronz dokadnie pocyatek
Kod:
<HTML xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office">
<HEAD>
<TITLE>PZHGP Oddział radziejow Brześć Kujawski</TITLE>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2" />
<meta http-equiv="Content-Language" content="pl" />

<style type="text/css" >
body{font-family:verdana;color:#C4D2EA;}
a{
color:white;
text-decoration:none;
}
a:hover{
color:white;
text-decoration:underline;
}
.menu{
[/color]
PROSZE O POMOC


RE: hasło na strone - BlueMan - 02-07-2009

On nie jest w ogóle bezpieczny! KAŻDY będzie mógł wejść na Twoją stronę po podejrzeniu źródła strony!

Umieść cały kod w BODY - tuż nad formularzem i tyle. Będzie działać na pewno :]


RE: hasło na strone - djoaza - 08-07-2009

albo poszukaj latwiejsze może logowanie na sesjach albo logowanie JS


RE: hasło na strone - Leja - 08-07-2009

kto teraz robi hasło w HTML? Sad


RE: hasło na strone - KowR - 08-07-2009

Twórca posta? Wink

Logowanie JS? Też możesz podejrzeć hasło przecież... Bo masz tam ifa, że jeżeli Twój wpisany kod == 'haslo' to masz dostęp do www. Najlepszym wyjściem będzie stworzenia logowania językiem działającym po stronie serwera - najpopularniejszym i najłatwiejszym jest PHP (jeżeli to ma być logowanie tylko dla 1 osoby na określone z góry hasło to możesz to logowanie zrobić bez bazy danych - w sumie na to wystarczy tylko jeden if + formularz. Big Grin


RE: hasło na strone - Labsta.com - 08-07-2009

http://net.tutsplus.com/tutorials/php/user-membership-with-php/ i tyle Smile


RE: hasło na strone - Leja - 08-07-2009

no raczej tylko twórca... no to do twórcy żeby zrobił se logowanie w PHP i zapomniał że istnieje coś takiego jak hasło w HTML bo to Ci się raczej nie przyda ;p


RE: hasło na strone - KowR - 08-07-2009

Labsta, myślisz, że gość poradzi sobie w bazą danych i będzie wiedział jak ją wrzucić?

Wystarczy mu skrypt:

Kod:
<form action="" method="post>
<table>
<tr>
<td>
<input type="password" name="pass" value="haslo" />
</td>
</tr>
</table>
</form>

<?php

$pass = htmlspecialchars(stripslashes(trim($_POST['pass'])), ENT_QUOTES);

if($pass == 'twojehaslo') {
// wszystko co ma się dziać po zalogowaniu
} else {
echo 'wpisane hasło jest złe!';
}

?>

Edit:
W polu twojehaslo wpisz hasło, które ma chronić Twoją stronę np.: jhdwahgdawdh


P.S
Pisane z palca.


RE: hasło na strone - djoaza - 08-07-2009




RE: hasło na strone - neo_17 - 21-07-2009

jak jeszczze autor tematu ma problem to mu napisze takowy skrypt Smile tylko niech tu napisze czy trzeba bo nie bede sie na darmo meczyl ;p