[Linux-programlama] Re: [PHP] Üst Dizinlerden Dosya Dahil Etmek ?

---------

[Linux-programlama] Re: [PHP] Üst Dizinlerden Dosya Dahil Etmek ?

From: Erdem ARTAN <badibere_at_gmail.com>
Date: Sat, 23 Aug 2008 21:40:16 +0300
Message-ID: <3d54862b0808231140q5f436d69p109264dffe9b13e8@mail.gmail.com>

Yardımlarınız için teşekkür ederim.

2008/8/23 Ozgur KOCA <ozgurkoca_at_gmail.com>

> İç içe include'ların yüksek bir sorun olma potansiyeli var. Kodlar
> kalınlaştıkça iyice içinden çıkılmaz bir hal alabilir. Herzaman realpath
> dediği şeyi kullanmak iyidir. Şahsen
> include(dirname(__FILE__).'/script.php'); şeklinde kullanmayı tercih ederim.
>
>
> Sanırım settings.php içindeki include'u aşağıdaki şekilde değiştirirseniz
> olacaktır;
>
> include( dirname(__FILE__).'/../Settings/MySQL.php');
>
> Kolay gelsin.
>
>
>
>
>
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> Özgür Koca
> Adres: Samsun, E.M.L Web Teknolojileri Dalı Şefi
> Tel: (362) 231 6855, GSM: (505) 282 2452
> http://www.tankado.com/ ¦ ozgurkoca[at]gmail.com
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
>
> 2008/8/23 Erdem ARTAN <badibere_at_gmail.com>
>
>> Özgür bey,
>>
>> Sanırım demek istediğinizi anladım ve sorunumu da buldum.
>> Sorun şu :
>>
>> Ben ana dizindeki index.php ile MenuProcess/Settings.php' yi çağırıyorum.
>> Settings.php 'nin içinde include "../Settings/Mysql.php" var.
>> Anladığım kadarıyla bu kod olduğu gibi index.php'ye işliyor ve doğal
>> olarak hata veriyor.
>>
>> Sanırım dediğiniz gibi .. yı silmem gerekecek. Fakat olası işlemlere karşı
>> silmeden yapabilme şansım var mı?
>>
>> 2008/8/23 Ozgur KOCA <ozgurkoca_at_gmail.com>
>>
>> Eğer, hataya neden olan kod index.php de yer alıyorsa; Çıktılardan da
>>> anlaşılacağı üzere Settings dizini bir üst dizde değil aynı dizinde yer
>>> alıyor.
>>>
>>> include "../Settings/Mysql.php";
>>>
>>> yerine
>>>
>>> include "Settings/Mysql.php";
>>>
>>> yazmak gerekiyor.
>>>
>>>
>>> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>>> Özgür Koca
>>> Adres: Samsun, E.M.L Web Teknolojileri Dalı Şefi
>>> Tel: (362) 231 6855, GSM: (505) 282 2452
>>> http://www.tankado.com/ ¦ ozgurkoca[at]gmail.com
>>> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>>>
>>>
>>>
>>> 2008/8/23 Erdem ARTAN <badibere_at_gmail.com>
>>>
>>>> Mehmet Bey çıktı şu şekildedir :
>>>>
>>>> /var/www/localhost/htdocs/IEEE/index.php
>>>> /var/www/localhost/htdocs/IEEE/Settings/Mysql.php :: OK
>>>> ../Settings/Mysql.php :: ERROR
>>>> ------------------------------
>>>> MenuProcess
>>>> .
>>>> index.php~
>>>> Settings
>>>> ..
>>>> index.php
>>>> ------------------------------
>>>> pisi-index.xml~
>>>> index-ptbr.html
>>>> index-tr.html
>>>> pisi-index3.xml
>>>> icons
>>>> IEEE
>>>> pardus.png
>>>> index-es.html
>>>> index-de.html
>>>> pisi-index2.xml~
>>>> apache.css
>>>> apache_pb.gif
>>>> .
>>>> pisi-index2.xml
>>>> pisi-index.xml
>>>> ..
>>>> pisi-index3.xml~
>>>> index.html
>>>> phpmyadmin
>>>>
>>>> 23 Ağustos 2008 Cumartesi 13:19 tarihinde Mehmet Gürevin <
>>>> mehmetgurevin_at_gmail.com> yazdı:
>>>>
>>>> eklemeyi unutmuşum, bu kodu include methodunu kullandığınız sayfada
>>>>> çalıştırmayı deneyin.
>>>>>
>>>>> 2008/8/23 Mehmet Gürevin <mehmetgurevin_at_gmail.com>:
>>>>> > <?php
>>>>> > echo($_SERVER['SCRIPT_FILENAME'].'<br>');
>>>>> >
>>>>> >
>>>>> if(file_exists('/var/www/localhost/htdocs/IEEE/Settings/Mysql.php')){
>>>>> >
>>>>> echo('/var/www/localhost/htdocs/IEEE/Settings/Mysql.php :: OK<br>');
>>>>> > }else{
>>>>> >
>>>>> echo('/var/www/localhost/htdocs/IEEE/Settings/Mysql.php :: ERROR<br>');
>>>>> > }
>>>>> >
>>>>> > if(file_exists('../Settings/Mysql.php')){
>>>>> > echo('../Settings/Mysql.php :: OK<br>');
>>>>> > }else{
>>>>> > echo('../Settings/Mysql.php :: ERROR<br>');
>>>>> > }
>>>>> >
>>>>> > echo('<hr>');
>>>>> >
>>>>> > $dh = opendir('./');
>>>>> > while($dir = readdir()){
>>>>> > echo($dir.'<br>');
>>>>> > }
>>>>> > closedir($dh);
>>>>> >
>>>>> > echo('<hr>');
>>>>> >
>>>>> > $dh = opendir('../');
>>>>> > while($dir = readdir()){
>>>>> > echo($dir.'<br>');
>>>>> > }
>>>>> > closedir($dh);
>>>>> >
>>>>> > echo('<hr>');
>>>>> > ?>
>>>>> > yukarıdaki kodun çıktısını gönderebilirmisiniz
>>>>> >
>>>>> > 2008/8/23 Erdem ARTAN <badibere_at_gmail.com>:
>>>>> >> 1) realpath kullanırken aldığım hata
>>>>> >>
>>>>> >> Warning: include() [function.include]: Failed opening '' for
>>>>> inclusion
>>>>> >> (include_path='.:/usr/share/php5/PEAR') in
>>>>> >> /var/www/localhost/htdocs/IEEE/MenuProcess/Settings.php on line 3
>>>>> >>
>>>>> >> 2) realpath KULLANMADAN aldığım hata
>>>>> >>
>>>>> >>
>>>>> >> Warning: include(../Settings/Mysql.php) [function.include]: failed
>>>>> to open
>>>>> >> stream: No such file or directory in
>>>>> >> /var/www/localhost/htdocs/IEEE/MenuProcess/Settings.php on line 2
>>>>> >>
>>>>> >> Warning: include() [function.include]: Failed opening
>>>>> >> '../Settings/Mysql.php' for inclusion
>>>>> >> (include_path='.:/usr/share/php5/PEAR') in
>>>>> >> /var/www/localhost/htdocs/IEEE/MenuProcess/Settings.php on line 2
>>>>> >>
>>>>> >>
>>>>> >> İlgili dosyalar yerlerinde mevcuttur.
>>>>> >>
>>>>> >> 23 Ağustos 2008 Cumartesi 13:03 tarihinde Mehmet Gürevin
>>>>> >> <mehmetgurevin_at_gmail.com> yazdı:
>>>>> >>>
>>>>> >>> yaptığınız işlemde bir sorun yok. include '../Settings/Mysql.php"
>>>>> >>> komutu ile dosya belirtildiği gibi varsa yani bir üst klasörde
>>>>> >>> Settings adında bir klasör ve onun içinde de Mysql.php dosyası
>>>>> varsa
>>>>> >>> yüklenmeli. sanırım başka bir sorun var.
>>>>> >>>
>>>>> >>> almış olduğunuz hatayıda yazsaydınız daha fazla yardımcı olabilidik
>>>>> >>> sanırım.
>>>>> >>>
>>>>> >>> 2008/8/23 Erdem ARTAN <badibere_at_gmail.com>:
>>>>> >>> > Merhaba,
>>>>> >>> >
>>>>> >>> > Php'de bir üst dizindeki Settings dizininin içerisinde bulunan
>>>>> Mysql.php
>>>>> >>> > yi
>>>>> >>> > dahil etmeye çalışıyorum.
>>>>> >>> >
>>>>> >>> > Bunun için
>>>>> >>> >
>>>>> >>> > include "../Settings/Mysql.php";
>>>>> >>> >
>>>>> >>> > ve
>>>>> >>> >
>>>>> >>> > $a = realpath("../Settings/Mysql.php");
>>>>> >>> > include $a;
>>>>> >>> >
>>>>> >>> > komutlarını ayrı ayrı denedim. Fakat her ikisi de hata verdi.
>>>>> >>> >
>>>>> >>> > PHP 5 yüklü sistemde.
>>>>> >>> >
>>>>> >>> > Sorun nedir?
>>>>> >>> >
>>>>> >>> > --
>>>>> >>> > Yarınları Görebilmem İçin Sadece Bir Işık!
>>>>> >>> >
>>>>> >>> > _______________________________________________
>>>>> >>> > Linux-programlama mailing list
>>>>> >>> > Linux-programlama_at_liste.linux.org.tr
>>>>> >>> > http://liste.linux.org.tr/mailman/listinfo/linux-programlama
>>>>> >>> >
>>>>> >>> >
>>>>> >>> _______________________________________________
>>>>> >>> Linux-programlama mailing list
>>>>> >>> Linux-programlama_at_liste.linux.org.tr
>>>>> >>> http://liste.linux.org.tr/mailman/listinfo/linux-programlama
>>>>> >>
>>>>> >>
>>>>> >>
>>>>> >> --
>>>>> >> Yarınları Görebilmem İçin Sadece Bir Işık!
>>>>> >>
>>>>> >> _______________________________________________
>>>>> >> Linux-programlama mailing list
>>>>> >> Linux-programlama_at_liste.linux.org.tr
>>>>> >> http://liste.linux.org.tr/mailman/listinfo/linux-programlama
>>>>> >>
>>>>> >>
>>>>> >
>>>>> _______________________________________________
>>>>> Linux-programlama mailing list
>>>>> Linux-programlama_at_liste.linux.org.tr
>>>>> http://liste.linux.org.tr/mailman/listinfo/linux-programlama
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> Yarınları Görebilmem İçin Sadece Bir Işık!
>>>>
>>>> _______________________________________________
>>>> Linux-programlama mailing list
>>>> Linux-programlama_at_liste.linux.org.tr
>>>> http://liste.linux.org.tr/mailman/listinfo/linux-programlama
>>>>
>>>>
>>>
>>> _______________________________________________
>>> Linux-programlama mailing list
>>> Linux-programlama_at_liste.linux.org.tr
>>> http://liste.linux.org.tr/mailman/listinfo/linux-programlama
>>>
>>>
>>
>>
>> --
>> Yarınları Görebilmem İçin Sadece Bir Işık!
>>
>> _______________________________________________
>> Linux-programlama mailing list
>> Linux-programlama_at_liste.linux.org.tr
>> http://liste.linux.org.tr/mailman/listinfo/linux-programlama
>>
>>
>
> _______________________________________________
> Linux-programlama mailing list
> Linux-programlama_at_liste.linux.org.tr
> http://liste.linux.org.tr/mailman/listinfo/linux-programlama
>
>

-- 
Yarınları Görebilmem İçin Sadece Bir Işık!

_______________________________________________
Linux-programlama mailing list
Linux-programlama_at_liste.linux.org.tr
http://liste.linux.org.tr/mailman/listinfo/linux-programlama
Received on Sat 23 Aug 2008 - 21:04:29 EEST

---------

Bu arsiv hypermail 2.2.0 tarafindan uretilmistir.