

Web Programlama Dillerinden Anlayanlar - Basit Bir Yardım
-
eskiden kullanıcı giriş paneli yazdığım bi kodu paylaşayım istersen editler kullanırsın
kullanicigiris.html olarak bunu kaydet
<html>
<head>
<meta http-equiv="Content-Language" content="tr">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1254">
<title>Kullanıcı girişi</title>
<script language="vbscript">
sub B1_Onclick()
if Document.frm.kullanici.value = "" then
msgbox "kullanıcı adı boş geçilemez!"
else
if Document.frm.sifre.value = "" then
msgbox "şifre boş geçilemez!"
else
Document.frm.submit()
end if
end if
end sub
</script>
</head>
<body>
<form name="frm" action="http://localhost/asp/kullanici_kayit/kullanicikontrol.asp" method="post">
<table border="1" stlye="border-collapse": collapse" widh="56&"%>
<tr>
<td widh="140">Kullanıcı Adı</td>
<td><input type="text" name="submitb" size="23"></td>
</tr>
<tr>
<td widh="140">Şifre</td>
<td><input type="password" name="submitb" size="23"></td>
</tr>
<tr>
<td widh="140"><a href="http://localhost/asp/kullanici_kayit/kullanicikayit.html">Üye Olmak İçin Tıklayınız</a></td>
<td input type="button" name="b1" value="giriş">
<input type="submit" value="Giriş" name="B1"></td>
</tr>
</table>
</form>
</body>
</html>----------------------------
kullanicikontrol.asp olarak bunu kaydet
<%
kullaniciD=request.form("kullanici")
sifreD=request.form("sifre")
set Conn = server.createobject("ADODB.Connection")
set rs = server.createobject ("adodb.recordset")
Conn.open "provider=microsoft.jet.oledb.4.0;data source=C:\Inetpub\wwwroot\asp\database11.mdb"
sqlkod ="select * from kullaniciT where KULLANICIADI='"&kullaniciD&"' and SIFRE='"sifreD"'"
rs.open sqlkod,Conn
if not rs.eof then
response.redirect "http://localhost/asp/kullanici_kayit/index11.html"
else
response.write kullaniciD &"isminde kayıtlı bir kullanıcı yoktur üye olmak için <a href='http://localhost/asp/kullanicikayit.html'>tıklayınız</a>"
end if
%>-----------------------------------------
kullanicikayit.asp olarakta bunu kaydet
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1254">
<title>Kullanici Giriş</title>
<script language="vbscript">
sub B1_Onclick()
if Document.frm1.kullanici.value = "" then
msgbox "kullanıcı adı boş geçilemez!"
document.frm1.kullanici.focus
else
if Document.frm1.sifre.value = "" then
msgbox "şifre boş geçilemez!"
document.frm1.sifre.focus
else
if Document.frm1.tekrarsifre.value = "" then
msgbox "Tekrar Şifre boş geçilemez!"
document.frm1.tekrarsifre.focus
else
if Document.frm1.adi.value = "" then
msgbox "adi boş geçilemez!"
document.frm1.adi.focus
else
if Document.frm1.soyadi.value = "" then
msgbox "soyadi boş geçilemez!"
document.frm1.soyadi.focus
else
if Document.frm1.email.value = "" then
msgbox "E-mail boş geçilemez!"
document.frm1.email.focus
else
if Document.frm1.sifre.value <> document.frm.tekrarsifre.value then
msgbox "sifre ve tekrar sifre ayni olmali"
else
document.frm1.submit()
end if
end if
end if
end if
end if
end if
end if
end sub
</script>
</head>
<body>
<form name="frm" action="http://localhost/asp/kullanici_kayit/kullanicikayit.asp" method="post">
<table border="1" style="border-collapse: collapse" widh="53&" width="356">
<tr>
<td widh="158" width="99">Kullanıcı adı</td>
<td><input type="text" name="kullanici" size="47">*
</tr>
<tr>
<td widh="158" width="99">Şifre</td>
<td input type="password" name="sifre" size="47">
<input type="password" name="sifre" size="47">*
</tr>
<tr>
<td widh="158" width="99">Tekrar Şifre</td>
<td input type="password" name="tekrarsifre" size="47">
<input type="password" name="tekrarsifre" size="47">*</td>
</tr>
<tr>
<td widh="158" width="99">Adı</td>
<td input type="text" name="adi" size="47">
<input type="text" name="adi" size="47">*</td>
</tr>
<tr>
<td widh="158" width="99" height="27">Soyadı</td>
<td input type="text" name="soyadi" size="47" height="27">
<input type="text" name="soyadi" size="47">*</td>
</tr>
<tr>
<td widh="158" width="99" height="27">Adres</td>
<td input type="text" name="adres" size="47" height="27">
<input type="text" name="adres" size="47">*</td>
</tr>
<tr>
<td widh="158" width="99">Tel</td>
<td input type="password" name="Tel" size="47">
<input type="text" name="tel" size="47">*</td>
</tr>
<tr>
<td widh="158" width="99">E-mail</td>
<td input type="text" name="email" size="47">
<input type="text" name="email" size="47">*</td>
</tr>
<tr>
<td widh="158" width="99">Meslek</td>
<td input type="text" name="Meslek" size="47">
<input type="text" name="meslek" size="47"></td>
</tr>
<tr>
<td widh="158" width="99">Yaş</td>
<td input type="password" name="Yaş" size="47">
<input type="text" name="yas" size="47"></td>
</tr>
<tr>
<td widh="158" width="99">Cinsiyet</td>
<td input type="text" name="cinsiyet" size="47">
<select size="1" name="cinsiyet">
<option>Bay</option>
<option>Bayan</option>
</select></td>
</tr>
</table>
</form>
<form name="frm3" action="http://localhost/kullanici_kayit/kullanicikayit.asp" method="post">
<input type="submit" name="submitb" value="kaydet">
</form>
</body>
</html>---------------------------
index11.html olarakta bunu kaydet
<html>
<head>
<title>böyle bir üye yoktur</title>
<body bgcolor="black">
<font color="red" size=6>
<center> böyle bir üye yoktur</center>
</head>
</html>---------------------
kodları incele bak kullanicikontrol.asp deki veritabanı yolunu değiştir. microsoft acsess i aç o yazdığım ism soyisim ve diğer bilgilere göre tablo oluştur.
kullanicikayit.asp deki vbscript li kodları incele istemediğin sorguyu sil. ftp için böyle olacak. mail için denemedim ama mailto:mailadresin olarak yazarsan actionları olabilir.
olmassa formmail oluşturup kodları inject edebilirsin action u kaldırmayı unutma.
istersen bunun veritabanınıda boş haliyle paylaşırım.
-
Blitz bunu yazdı:
-----------------------------
-----------------------------Hoca bu kod doğu ve güzel kodda kullanıcı adı ve şifre alınması kısmı SQL injection a son derce açık ;)