Password Procection
Jelentkezz be a hozzászóláshoz.
Magyarul:
1. Megoldható Javascripttel:
<script type="text/javascript">
<!--
function checkit()
{
if (document.Form.pswrd.value=="jelszavam") {
window.document.location.href = "helyes.htm";
} else {
window.document.location.href = "helytelen.htm";
}
}
//-->
</script>
<form name="Form" method="post" action="javascript:checkit()">
<input type="password" name="pswrd">
<input type="submit" value="OK">
</form>
Vagy ugyanez pepitában, kicsit "biztonságosabban":
<script type="text/javascript">
<!--
function checkit()
{
if (document.Form.pswrd.value=="") {
alert("Kérem a jelszót!");
} else {
window.document.location.href = document.Form.pswrd.value+".htm";
}
}
//-->
</script>
<form name="Form" method="post" action="javascript:checkit()">
<input type="password" name="pswrd">
<input type="submit" value="OK">
</form>
2. Megoldható szerveroldali nyelvvel. Itt egy PHP-s példa.
1. Megoldható Javascripttel:
<script type="text/javascript">
<!--
function checkit()
{
if (document.Form.pswrd.value=="jelszavam") {
window.document.location.href = "helyes.htm";
} else {
window.document.location.href = "helytelen.htm";
}
}
//-->
</script>
<form name="Form" method="post" action="javascript:checkit()">
<input type="password" name="pswrd">
<input type="submit" value="OK">
</form>
Vagy ugyanez pepitában, kicsit "biztonságosabban":
<script type="text/javascript">
<!--
function checkit()
{
if (document.Form.pswrd.value=="") {
alert("Kérem a jelszót!");
} else {
window.document.location.href = document.Form.pswrd.value+".htm";
}
}
//-->
</script>
<form name="Form" method="post" action="javascript:checkit()">
<input type="password" name="pswrd">
<input type="submit" value="OK">
</form>
2. Megoldható szerveroldali nyelvvel. Itt egy PHP-s példa.
#6
<#wilting>#wilting> magyarul ?
#5
Ja, sokféle lehet még persze, pl perl is, lényeg hogy szerver oldalon fusson le, és a forráskódot ne lássa a kliens.
#3
java ja, azt valaki belenéz a forrásba, és már tudja is a jelszot😊)
PHPben kell megirni, 10-15sor az egész, csak ahhoz olyen szerver kell ami engedi.
PHPben kell megirni, 10-15sor az egész, csak ahhoz olyen szerver kell ami engedi.
#1
hogy csináljak weblapomra ilyet??