Ccs c webserver için şifre ekleme

Başlatan Emre MERMİ, 10 Kasım 2017, 16:26:17

Emre MERMİ

Merhaba,

Ccs c de project wizard ile oluşturulan bir web server için şifre konuşabilir mi ? Yapan veya nasıl yapılacağı hakkında bir fikri olan var mı ? Şuan pc başında olmadığım için kod ekleyemiyorum ama en azından fikir alışverişi olması açısından sormak istiyorum.

Teşekkürler

ismail kaya

Proje'yi oluşturduğun yerdeki pages klasöründeki index.html nin adını değiştir ör:index2.html şu aşağıdaki kodları index.html olarak kaydet. Sonra eğer şifre doğruysa index2.html değilse hata sayfası olabilir. 

index.html
<!-- TWO STEPS TO INSTALL MULTIPLE USERS:
 
1. Copy the first code into the HEAD of your HTML document
2. Put the last coding into the BODY of your HTML document -->
 
<!-- STEP ONE: Copy this code into the HEAD of your login HTML document -->
 
<HEAD>
 
<SCRIPT LANGUAGE="JavaScript">
 
<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->
 
<!-- Begin
function Login(){
var done=0;
var username=document.login.username.value;
username=username.toLowerCase();
var password=document.login.password.value;
password=password.toLowerCase();
if (username=="admin" && password=="picproje") { window.location="GİDİLECEK URL"; done=1; }
if (username=="member2" && password=="password2") { window.location="page2.html"; done=1; }
if (username=="member3" && password=="password3") { window.location="page3.html"; done=1; }
if (done==0) { alert("yanlış şifre!!!"); }
}
// End -->
</SCRIPT>
 
<!-- STEP TWO: Paste this code into the BODY of your HTML document -->
 
<BODY>
 
<center>
<form name=login>
<table width=225 border=1 cellpadding=3>
<tr><td colspan=2><center><font size="+2"><b>Kullanıcı Girişi</b></font></center></td></tr>
<tr><td>Username:</td><td><input type=text name=username></td></tr>
<tr><td>Password:</td><td><input type=text name=password></td></tr>
<tr><td colspan=2 align=center><input type=button value="Login!" onClick="Login()"></td></tr>
</table>
</form>
</center>
 
</center><p>