turkcedil
> Anasayfa > Üœye Paneli
Web Galeriden
Sevgililer Günü Kalpli
Attachment
Kullanıcı Bİlgileri
Bilisim.teorisi
Avatar

Mesajlar: 4
Katkılar: 4

Cinsiyet: Seçilmedi
Çevrimiçi: Hayır

Kayıtlı: 16/07/2009 10:51
Email:bilisimteorisi at gmail dot com
 
Özel mesaj gönder
Date 17/07/2009 07:17
Sorun http_vars_post kullanılmasından kaynaklanıyormuş, doğrusu aşağıdadır.

code
        $data = "<?PHPn";
               
                $_POST['admin_pwd'] = $admin_pwd1;
                unset ($_POST['admin_pwd1']);
                unset ($_POST['admin_pwd2']);
                unset ($_POST['action']);

                foreach ($_POST as $anahtar=>$deger ) {
                    $data .= "$"."$anahtar = "$deger" ;n";
                        }
                $data .= '?'.">\n";
Date 16/07/2009 11:20
Ayarlar kaydedilmiyor.

Aşağıda ki kodlar index.php içinde yer alan kodlardır, index.php dosyasının bulunduğu dizinde ayarlar.php, bt.php, form.php isimli dosyalar var.

aynı dizinde bulunan klasörlerse
vr(içinde 3 adet dosya var veriler.php, reklam.php ve ayarların kaydolduğu db.php)
img(görseller)
css_js(js ve css dosyalarının bulunduğu klasör)

code
///////////////////////////////////////////////////////////////
case "ayar": // Ayarlar Sayfası
        if ($admin){
                pheader ("Ziyaretçi Defteri Ayarları");
                header("Cache-Control: no-cache, must-revalidate");
                echo "<p class="baslik">$pname Ziyaretçi Defteri Ayarları</p>

<div align="
center"><a class="buton" href="http://www.bilisimteorisi.org/">Ana Sayfa</a> <a class="buton" href="index.php">Mesajlar</a> <a class="buton" href="index.php?action=form">Mesaj Gönder</a> <a class="buton" href="index.php?action=logout">Çıkış yap</a>";
                // Config dosyası varlığı ve yazma özelliği kontrolü
                if (file_exists($config_file)){
                        echo "</div><br /><b>$config_file</b> dosyasının yazma özelliği: ";
                        if (is_writable($config_file)){echo "<font color="green"><b>AÇIK</b></font><br /><br />";}
                        else {
                                echo "<font class="belirtec"<b>KAPALI</b></font><br />";
                                echo "Bu yüzden ayarları kaydedemeyeceksiniz.<br />Dosyaya yazma özelliği atayınız.";
                                $err=1;
                                }
                        }
                else{echo "<b>$config_file</b> dosyası: <font class="belirtec"><b>YOK</b></font><br />Dosyayı oluşturunuz";$err=1;}
                if ($err==0){ include ("ayarlar.php");}
                }
        else{header ("Location: $scradr?action=login");}
        break;
case "ayarkaydet": // Ayarları kaydet
    if ($admin){
                if ($admin_pwd1 != $admin_pwd2){
                        hatamsj("HATA: Parolalar eşit değil !","Parolalar eşit değil !.");
                        break;
                    }
                $data = "<?PHPn";
                $HTTP_POST_VARS['admin_pwd'] = $admin_pwd1;
                unset ($HTTP_POST_VARS['admin_pwd1']);
                unset ($HTTP_POST_VARS['admin_pwd2']);
                unset ($HTTP_POST_VARS['action']);

                foreach ($HTTP_POST_VARS as $anahtar=>$deger ) {
                    $data .= "$"."$anahtar = "$deger" ;n";
                        }
                $data .= '?'.">\n";
                $dp = fopen($config_file, "w");
                flock($dp,2);
                if (fwrite($dp, $data) === FALSE) {
                        hatamsj("HATA: Data dosyasına yazılamadı",
                        "Ayarların kaydedildiği data dosyasına bir sorun yüzünden kayıt yapılamadı.<br />Ayarlar kaydedilmedi.");
                        break;
                        }
                flock($dp,3);
                fclose($dp);
                pheader("İşlem Tamam");
                echo "İşlem Tamam.<br />";
                echo "<a class="buton" href="$scradr">Mesajlar</a>";
                }
         else{header ("Location: $scradr?action=login");}
         break;


Şunlarsa ayarlar.php dosyasında ki kodlar



code

<style type="text/css">
#dhtmltooltip{
position: absolute;
width: 220px;
border: 1px solid black;
padding: 2px;
background-color: #DFDFFF;
visibility: hidden;
z-index: 100;
font-size: 8pt;
/*Remove below line to remove shadow. Below line should always appear last within this CSS*/
filter: progidSmileXImageTransform.Microsoft.Shadow(color=gray,direction=135);
}
</style>

<div id="dhtmltooltip"></div>

<script type="text/javascript">

/***********************************************
* Cool DHTML tooltip script- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/


var offsetxpoint=-60 //Customize x offset of tooltip
var offsetypoint=20 //Customize y offset of tooltip
var ie=document.all
var ns6=document.getElementById && !document.all
var enabletip=false
if (ie||ns6)
var tipobj=document.all? document.all["dhtmltooltip"] : document.getElementById? document.getElementById("dhtmltooltip") : ""

function ietruebody(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function ddrivetip(thetext, thecolor, thewidth){
if (ns6||ie){
if (typeof thewidth!="undefined") tipobj.style.width=thewidth+"px"
if (typeof thecolor!="undefined" && thecolor!="") tipobj.style.backgroundColor=thecolor
tipobj.innerHTML=thetext
enabletip=true

return false
}
}

function positiontip(e){
if (enabletip){
var curX=(ns6)?e.pageX : event.clientX+ietruebody().scrollLeft;
var curY=(ns6)?e.pageY : event.clientY+ietruebody().scrollTop;
//Find out how close the mouse is to the corner of the window
var rightedge=ie&&!window.opera? ietruebody().clientWidth-event.clientX-offsetxpoint : window.innerWidth-e.clientX-offsetxpoint-20
var bottomedge=ie&&!window.opera? ietruebody().clientHeight-event.clientY-offsetypoint : window.innerHeight-e.clientY-offsetypoint-20

var leftedge=(offsetxpoint<0)? offsetxpoint*(-1) : -1000

//if the horizontal distance isn't enough to accomodate the width of the context menu
if (rightedge<tipobj.offsetWidth)
//move the horizontal position of the menu to the left by it's width
tipobj.style.left=ie? ietruebody().scrollLeft+event.clientX-tipobj.offsetWidth+"px" : window.pageXOffset+e.clientX-tipobj.offsetWidth+"px"
else if (curX<leftedge)
tipobj.style.left="5px"
else
//position the horizontal position of the menu where the mouse is positioned
tipobj.style.left=curX+offsetxpoint+"px"

//same concept with the vertical position
if (bottomedge<tipobj.offsetHeight)
tipobj.style.top=ie? ietruebody().scrollTop+event.clientY-tipobj.offsetHeight-offsetypoint+"px" : window.pageYOffset+e.clientY-tipobj.offsetHeight-offsetypoint+"px"
else
tipobj.style.top=curY+offsetypoint+"px"
tipobj.style.visibility="visible"
}
}

function hideddrivetip(){
if (ns6||ie){
enabletip=false
tipobj.style.visibility="hidden"
tipobj.style.left="-1000px"
tipobj.style.backgroundColor=''
tipobj.style.width=''
}
}

document.onmousemove=positiontip

</script>

<div align="center">
<form method="POST">
<input type="hidden" name="action" value="ayarkaydet">
<input type="hidden" name="setok" value="1">
<table bgcolor="#f8f8f8" bordercolor="#aaaaaa" border="0">


<tr>
<td>Web Sayfa Adı</td>
<td>
<input name="pname" size="35" value="<?php echo "$pname"; ?>"><img border="0" src="img/tooltip.gif" width="20" height="16"
onMouseover="ddrivetip('Web sayfa adını girin. Bu ad ziyaretçi defteri başlığında da görünür')";
onMouseout="hideddrivetip()"></td>
</tr>
<tr>
<td>Ana Sayfa Adresi</td>
<td >
<input name="homepage" size="30" value="<?php echo "$homepage"; ?>"><img border="0" src="img/tooltip.gif" width="20" height="16"
onMouseover="ddrivetip('Ziyaretçi defterinden ana sayfaya erişmek için link bulunur. Bu link tıklandığında açılacak ana sayfa adresini giriniz. http:// kısmını unutmayın')";
onMouseout="hideddrivetip()"></td>
</tr>
<tr>
<td>Sayfa arayüzü(tema)</td>
<td><select size="1" name="skin">

<option value="<?php if ($skin == "bt"Smile{echo "selected";} ?>">Default</option>

</select><img border="0" src="img/tooltip.gif" width="20" height="16"
onMouseover="ddrivetip('Sayfanın görünümünü var olan bir arayüz ile kolayca değiştirebilirsiniz.')";
onMouseout="hideddrivetip()"></td>
</tr>
<tr>
<td>Yönetici Parolası</td>
<td>
<p><input name="admin_pwd1" size="20" value="<?php echo "$admin_pwd"; ?>" type="password"><img border="0" src="img/tooltip.gif" width="20" height="16"
onMouseover="ddrivetip('Ziyaretçi defterinin ayarlarını yapmak ve mesajları yönetmek için bir parola belirleyin.<br />Parolayı değiştirmeyecekseniz yeniden girmeniz gerekmez.')";
onMouseout="hideddrivetip()"></p>
</td>
</tr>

        <tr>
        <td>Yönetici Parolası(tekrar)</td>
        <td>
        <input name="admin_pwd2" size="20" value="<?php echo "$admin_pwd"; ?>" type="password"><img border="0" src="img/tooltip.gif" width="20" height="16"
onMouseover="ddrivetip('Üstteki parolanın aynısını girin')";
onMouseout="hideddrivetip()"></td>
        </tr>
<?php unset ($admin_pwd); ?>
<tr>
<td>Yönetici E-maili</td>
<td>
<input name="admin_email" size="30" value="<?php echo "$admin_email"; ?>"><img border="0" src="img/tooltip.gif" width="20" height="16"
onMouseover="ddrivetip('Email adresini girin. Eğer mesajaların bir kopyasının emailinize gönderilmesini isterseniz mesajlar bu emaile gönderilir.')";
onMouseout="hideddrivetip()"></td>
</tr>
<tr>
<td>Sayfa dil karakter kodu</td>
<td>
<input name="chrset" size="20" value="<?php echo "$chrset"; ?>"><img border="0" src="img/tooltip.gif" width="20" height="16"
onMouseover="ddrivetip('Sayfadaki yazıların doğru karakterlerle gösterilmesi için kullanılan dile uygun karakter kodunu giriniz.<br />Türkçe için: <b>ISO-8859-9</b>')";
onMouseout="hideddrivetip()"></td>
</tr>
<tr>
<td>Tarih biçimi</td>
<td>
<input name="tformat" size="20" value="<?php echo "$tformat"; ?>"><img border="0" src="img/tooltip.gif" width="20" height="16"
onMouseover="ddrivetip('Mesajların tarih ve saatinin gösteriliş biçim kodunu giriniz. Detaylı bilgiyi <a href='http://tr.php.net/manual/en/function.date.php'>tr.php.net/manual/en/function.date.php</a> adresinden edinebilirsiniz.<br />Türkiye için: <b>d/m/Y H:i</b> girebilirsiniz.')";
onMouseout="hideddrivetip()"></td>
</tr>
<tr>
<td>Mesaj yazıldıktan sonra</td>
<td>
<input type="radio" value="0" name="msgcnt"<?php if ($msgcnt==0){echo "checked";} ?>>Hemen yayınla
<img border="0" src="img/tooltip.gif" width="20" height="16"
onMouseover="ddrivetip('Mesaj onaylı kaydedilir ve onay beklemeden yayınlanır')";
onMouseout="hideddrivetip()"><br />
<input type="radio" value="1" name="msgcnt" <?php if ($msgcnt==1){echo "checked";} ?>>"<b class="belirtec">Mesajınız Onay Bekliyor</b>" yaz
<img border="0" src="img/tooltip.gif" width="20" height="16"
onMouseover="ddrivetip('Mesaj içeriği onaylanana kadar görünmez.<br />Mesaj içeriği dışındaki bilgiler görünür.<br />Mesaj onay bekliyor uyarı yazısı görünür.')";
onMouseout="hideddrivetip()"><br />
<input type="radio" value="2" name="msgcnt" <?php if ($msgcnt==2){echo "checked";} ?>>Mesajı
gösterme 
<img border="0" src="img/tooltip.gif" width="20" height="16"
onMouseover="ddrivetip('Mesaj onaylanana kadar mesaj ile ilgili hiçbir bilgi görünmez. Ancak yönetici görebilir.')";
onMouseout="hideddrivetip()"></td>
</tr>
<tr>
<td>Mesaj e-maille yöneticiye de gitsin</td>
<td>
<input type="checkbox" name="sendmsg2me" value="1" <?php if ($sendmsg2me==1) {echo "checked";} ?>><img border="0" src="img/tooltip.gif" width="20" height="16"
onMouseover="ddrivetip('İşaretli ise mesajların bir kopyası email adresinize gönderilir.')";
onMouseout="hideddrivetip()"></td>
</tr>
<tr>
<td>Sayfada Mesaj Sayısı</td>
<td><input name="mpp" size="4" value="<?php echo "$mpp"; ?>"><img border="0" src="img/tooltip.gif" width="20" height="16"
onMouseover="ddrivetip('Bir sayfada gösterilecek mesaj sayısını belirleyiniz.')";
onMouseout="hideddrivetip()"></td>
</tr>
<tr>
<td>Saat Farkı </td>
<td><input name="sf" size="6" value="<?php echo "$sf"; ?>">
dakika
<img border="0" src="img/tooltip.gif" width="20" height="16"
onMouseover="ddrivetip('Sunucu saati ile yerel bölgenizin saat farkını girerek tarih ve saatin doğru görünmesini sağlayabilirsiniz.')";
onMouseout="hideddrivetip()"><br />
Sunucu saati: <?php echo date("d/m/Y H:i"); ?></td>
</tr>
<tr>
<td>Aynı bilgisayardan<br />
yeni mesaj göndermek için<br />
bekleme aralığı </td>
<td>
<input name="wait_time" size="6" value="<?php echo "$wait_time"; ?>"> saniye
<img border="0" src="img/tooltip.gif" width="20" height="16"
onMouseover="ddrivetip('Aynı bilgisayardan ard ardına mesajlar yazarak ziyaretçi defterini kötüye kullananları önlemek için bekleme süresi belirleyiniz.<br />0(Sıfır) girerseniz hiç beklmeden tekrar mesaj gönderebilir')";
onMouseout="hideddrivetip()"></td>
</tr>
<tr>
<td>
Mesaj gönderiminde güvenlik kodu</td>
<td>
<input type="checkbox" name="gk" value="1"<?php if ($gk==1) {echo "checked";} ?>>Olsun
<input name="gkks" size="2" value="<?php echo "$gkks"; ?>">
karakter
(1-5)<img border="0" src="img/tooltip.gif" width="20" height="16"
onMouseover="ddrivetip('Mesaj gönderme formunda güvenlik kodu seçili ise mesaj gönderen kişi çıkan güvenlik kodunu girmelidir.<br />Karakter sayısı oluşacak güvenlik kod uzunluğudur.<br />1 ile 5 arası bir rakam giriniz')";
onMouseout="hideddrivetip()"></td>
</tr>
<tr>
<td>
İzin verilen HTML etiketleri</td>
<td>
<input name="htmltags" size="40" value="<?php echo "$htmltags"; ?>"><img border="0" src="img/tooltip.gif" width="20" height="16"
onMouseover="ddrivetip('Mesajlarda izin verilen HTML etiketlerini belirtiniz. <textarea><B><I><U></textarea> gibi')";
onMouseout="hideddrivetip()"></td>
</tr>
<tr>
<td>
Web adreslerini köprüye dönüştür</td>
<td>
<input type="checkbox" name="web2link" value="1" <?php if ($web2link==1) {echo "checked";} ?>>Evet<img border="0" src="img/tooltip.gif" width="20" height="16"
onMouseover="ddrivetip('İşaretli ise mesajlardaki web adresleri otomatik linke dönüştürülür.')";
onMouseout="hideddrivetip()"></td>
</tr>
<tr>
<td>
Birden çok boş satırı engelle</td>
<td>
<input type="checkbox" name="entersil" value="1" <?php if ($entersil==1) {echo "checked";} ?>>Evet<img border="0" src="img/tooltip.gif" width="20" height="16"
onMouseover="ddrivetip('İşaretli ise mesajlardaki birden çok sayıda entere basılmışsa bunları tek entere dönüştürür. Böylece fazladan boş satırlar silinir.')";
onMouseout="hideddrivetip()"></td>
</tr>
<tr>
<td>
Google Adsense Reklam</td>
<td>
<input type="checkbox" name="gadma" value="1"<?php if ($gadma==1) {echo "checked";} ?>>Mesaj
arasında
<input name="gadms" size="2" value="<?php echo "$gadms"; ?>">. mesajdan sonra
<br />
<input type="checkbox" name="gadsa" value="1"<?php if ($gadsa==1) {echo "checked";} ?>>Sayfa
altında</td>
</tr>
<tr>
<td>
Adsense yayıncı kodu</td>
<td>
ca-pub-<input name="gadyk" value="<?php echo "$gadyk"; ?>"> <img border="0" src="img/tooltip.gif" width="20" height="16"
onMouseover="ddrivetip('Adsense hesabınızın yayıncı kimlik kodu. ca-pub- ile başlar. ca-pub- dan sonraki rakamları buraya yazınız')";
onMouseout="hideddrivetip()"></td>
</tr>
<tr>
<td>
Mesaj data dosyası</td>
<td>
<input name="data_file" value="<?php echo $data_file; ?>"><img 05.07.2009 18:14:24border="0" src="img/tooltip.gif" width="20" height="16"
onMouseover="ddrivetip('Mesajların kaydedildiği data dosyası adı. VAR ve YAZILABİLİR olması gerekir')";
onMouseout="hideddrivetip()"><br />
<?PHP
if (file_exists($data_file)){
        echo '<font class="obelirtec"><b>VAR,</b></font>';
        if (is_writable($data_file)){echo ' <font class="obelirtec"><b>YAZILABİLİR</b></font>';}else {echo " <font color=red><b>YAZILAMAZ</b></font>";}
}
else {echo "<font class="belirtec"><b>YOK,</b></font>";}
?>
</td></tr></table>
<input type="submit" value="Ayarları Kaydet">
</form>
</div>



Yukarıda ki kodlar da ayarlar.php dosyasına ait, index.php dosyasından alıntıladığımız ilgili kodlarda, ayarlar.php dosyasında belirtilen değişkenlere yer verilmediğini ve bundan dolayıda vr/db.php dosyasına parola dışında bir değişken ve değeri yazım işleminin gerçekleşmediğini düşünüyoruz.

Sizce neden kaynaklanıyor olabilir ?
Date 16/07/2009 11:05
Merhaba Mesut Akcan'ın yaptığı Akcansoft isimli defteri geliştiriyoruz, defterden haberdar olan arkadaşlar bilir ki veriler bir txt belgesine yazılırdı ve adres satırına defterin veri deposu adresi yazıldığında tüm verilere erişebilirdik.

Bizde ki geliştirilmiş halinde veriler bir php dosyasına yazılıyor ve o dosyaya diretk erişim engellendi. Ajaxla güçlendirilen defterin, kaynak kodlarında ana üreticiden kaynaklanan hatalar giderildi.

Mesajlara mesaj numaraları atandı, tasarımı tarayıcılara uyumlu hale getirilerek, estetik bir görünüm kazandırıldı.

İfade ve diğer link sahibi görsellerin üzerine fare geldiğinde meydana gelen hover olayı kaldırıldı.

Geliştirmeyi http://www.bilisimteorisi.org/labaratuar/index.php adresinden takip edebilirsiniz

Sevgi ve Saygılarımızla
Bilişim Teorisi Ekibi
Date 16/07/2009 10:53
Merhaba, Bildiklerimizi paylaşmak bilmediklerimizi sormak için buradayız.

Sevgi ve Saygılarımızla
Bilişim Teorisi Ekibi.