Cum pun parola la o categorie?

Vezi subiectul anterior Vezi subiectul urmator In jos

Rezolvat Cum pun parola la o categorie?

Mesaj Scris de BuNu #WorldGame la data de Sam 8 Dec - 12:16

Buna ziua ForumGratuit ! Nu stiu daca titlul este asa de explicit dar vreau ca la o anumina categorie "Zona Adminilor" sa pot pune o parola pentru ca cei din staff si numai aceai sa poata intra pe acea categorie cand pun parola...
Daca cineva ma poate ajuta il rog sa o faca , Multumesc!

BuNu #WorldGame
Membru Forumgratuit

masculin

Mesaje : 131
Varsta : 22
Data de inscriere : 10/07/2012
Multumiri : 0
2 avertismente

http://worldgame.talk4her.com/

Sus In jos

Rezolvat Re: Cum pun parola la o categorie?

Mesaj Scris de VeteraNNN la data de Sam 8 Dec - 12:51

1. Faci o categorie vizibila numai unu anumit grup.
2. Un descrierea forumului (Exemplu: Admini) pui codul asta -->
Cod:
<script language="javascript">
<!--//
/*This Script allows people to enter by using a form that asks for a
UserID and Password*/
function pasuser(form) {
if (form.id.value=="JavaScript") {
if (form.pass.value=="Kit") {             
location="page2.html"
} else {
alert("Invalid Password")
}
} else {  alert("Invalid UserID")
}
}
//-->
</script>

<center>
<table bgcolor="white" cellpadding="12" border="1">
<tr><td colspan="2"><center><h1><i><b>Login
Area</b></i></h1></center></td></tr>
<tr><td><h1><i><b>UserID:</b></i></h1></td><td><form name="login"><input
name="id" type="text"></td></tr>
<tr><td><h1><i><b>Password:</b></i></h1></td><td><input name="pass"
type="password"></td></tr>
<tr><td><center><input type="button" value="Login"
onClick="pasuser(this.form)"></center></td><td><center><br><input
type="Reset"></form></td></tr></table></center>

if (form.id.value=="JavaScript") {
User ID
if (form.pass.value=="Kit") {
Parola
location="page2.html"
locatie (Exemplu /f1-)

Sau asta
Cod:
<script type = "text/javascript">

// Note: Like all Javascript password scripts, this is hopelessly insecure as the user can see
//the valid usernames/passwords and the redirect url simply with View Source. 
// And the user can obtain another three tries simply by refreshing the page. 
//So do not use for anything serious!

var count = 2;
function validate() {
var un = document.myform.username.value;
var pw = document.myform.pword.value;
var valid = false;

var unArray = ["Philip", "George", "Sarah", "Michael"];  // as many as you like - no comma after final entry
var pwArray = ["Password1", "Password2", "Password3", "Password4"];  // the corresponding passwords;

for (var i=0; i <unArray.length; i++) {
if ((un == unArray[i]) && (pw == pwArray[i])) {
valid = true;
break;
}
}

if (valid) {
alert ("Login was successful");
window.location = "http://www.google.com";
return false;
}

var t = " tries";
if (count == 1) {t = " try"}

if (count >= 1) {
alert ("Invalid username and/or password.  You have " + count + t + " left.");
document.myform.username.value = "";
document.myform.pword.value = "";
setTimeout("document.myform.username.focus()", 25);
setTimeout("document.myform.username.select()", 25);
count --;
}

else {
alert ("Still incorrect! You have no more tries left!");
document.myform.username.value = "No more tries allowed!";
document.myform.pword.value = "";
document.myform.username.disabled = true;
document.myform.pword.disabled = true;
return false;
}

}

</script>

<form name = "myform">
<p>USER NAME <input type="text" name="username">PASSWORD <input type="password" name="pword">
<input type="button" value="Check In" name="Submit" onclick= "validate()">
</p>

</form>

Nume Utilizatori
var unArray = ["Philip", "George", "Sarah", "Michael"]; // as many as you like - no comma after final entry
Parole
var pwArray = ["Password1", "Password2", "Password3", "Password4"]; // the corresponding passwords;
Locatia dupa logare
window.location = "http://www.google.com";

VeteraNNN
Membru activ

masculin

Mesaje : 485
Varsta : 22
Localizare : Undeva in spatele tau !!
Data de inscriere : 28/10/2012
Multumiri : 0
Membru exclus

Sus In jos

Rezolvat Re: Cum pun parola la o categorie?

Mesaj Scris de BuNu #WorldGame la data de Sam 8 Dec - 15:48

rezolvat multumesc mult Fericit

BuNu #WorldGame
Membru Forumgratuit

masculin

Mesaje : 131
Varsta : 22
Data de inscriere : 10/07/2012
Multumiri : 0
2 avertismente

http://worldgame.talk4her.com/

Sus In jos

Rezolvat Re: Cum pun parola la o categorie?

Mesaj Scris de VeteraNNN la data de Sam 8 Dec - 16:01

Cu placere Foarte fericit

VeteraNNN
Membru activ

masculin

Mesaje : 485
Varsta : 22
Localizare : Undeva in spatele tau !!
Data de inscriere : 28/10/2012
Multumiri : 0
Membru exclus

Sus In jos

Rezolvat Re: Cum pun parola la o categorie?

Mesaj Scris de Adi. la data de Mier 12 Dec - 23:12

topic rezolvat

Adi.
Membru onorific
Membru onorific

masculin

Mesaje : 3749
Localizare : Forumgratuit
Data de inscriere : 01/08/2012
Multumiri : 30
Niciun avertisment

Sus In jos

Vezi subiectul anterior Vezi subiectul urmator Sus

- Subiecte similare

Permisiunile acestui forum:
Nu puteti raspunde la subiectele acestui forum