[linux-programlama] Re: php dosyadan php yi cagirma header problemi

---------

From: Hasan Saral (hasansaral@introproduction.com)
Date: Sat 12 Jul 2003 - 16:29:03 EEST

  • Next message: Sancar Saran: "[linux-programlama] Re: php dosyadan php yi cagirma header problemi"

    > ana.php içinden
    > $x = include("include.php");
    > header($x);
    komutu bu sekilde yazarsam icerik once ekrana yazilir arkasindan header
    komutu gonderilir sanirim.

    Biraz daha aciklarsam soyle ana.php aslinda kendisinden talep edilen
    fonksiyonlara ait php
    leri cagiran bir yonetici gibi calsiyor.
    ama cagrilan fonksiyon bazen text deger bazen xml deger bazende bir imajin
    icerigi gibi farkli formatlarda deger donduruyor (bunu header komutu ile
    browsere belirtiyorum).
    benim oyle bir komuta ihtiyacim varki ana.php icinden o phpyi cagiracagim
    fakat ana.php cagirilmamis gibi cagrilan fonksiyonun gonderdigi farkli
    header degerleri browser tarafindan dogru algilanacak.

    redirect yaparsaniz (header(location :cagrilan.php )) hersey dogru calsiyor
    ama bu seferde mesela bir imaj datasi donuyorsa ve ben bunu bir imajin src=
    seklinde kaynagi olarak belirtirsem browser bunu anlamayacagi icin duzgun
    calismiyor.

    mesela header komutu yerine baska bir komutta onerebilirsiniz. veya include
    vb yerine bir komut.

    ----- Original Message -----
    From: "Onur Yalazi" <onuryalazi@mersin.edu.tr>
    To: <linux-programlama@liste.linux.org.tr>
    Sent: Saturday, July 12, 2003 1:05 AM
    Subject: [linux-programlama] Re: php dosyadan php yi cagirma header problemi

    > Hasan Saral wrote:
    >
    > > elimde ana.php ve include.php diye iki sayfa var. include.php baska
    > > bir serverde.
    > > include.php?mod=txt seklinde calistirirsam
    > > header ("Content-type: text/html; charset=utf-8");
    > > echo "deger1;deger2"
    > > komutlarini calistiriyorum.
    > > include.php?mod=xml seklinde calistirisam
    > > header ("Content-type: text/xml; charset=utf-8");
    > > echo "<test>deger</test>"
    > > komutlarini calistiriyorum.
    > > sorum su:
    > > ana.php icine include.php yi header komutu duzgun calisacak sekilde
    > > nasil ekleyebilirim. cunku include require fopen fpasstru bunlarin hic
    > > biri bana dogru deger dondurmuyor. her sey duzgun calisiyor fakat
    > > include.php icindeki gonderdigim header komutu islevsiz kaliyor.
    > > (include.php yi direkt cagirirsam hersey dogru calisiyor)
    > > header('location: include.php?mod=xml') komutunu onermeyin onu
    > > kullanmamam gerekiyor.(donen degeri <img
    > > source=include.php?mod=binary> seklinde kullanacagim yerler olacak
    > > cunku).
    > > Bilmem anlatabildimmi yardimlarinizi bekliyorum. Herkese iyi calismalar.
    > > Hasan Saral
    >
    > Merhaba,
    > (ya da iyi geceler :) )
    >
    > http://tr2.php.net/manual/en/function.include.php den al?nt?
    >
    > "When a file is included, parsing drops out of PHP mode and into HTML
    > mode at the beginning of the target file, and resumes again at the end.
    > For this reason, any code inside the target file which should be
    > executed as PHP code must be enclosed within valid PHP start and end
    > tags
    >
    <http://tr2.php.net/manual/en/language.basic-syntax.php#language.basic-synta
    x.phpmode>."
    >
    > Belki sorununuz bundan ibarettir. Eg(er sorun bundan deg(il ise
    > include.php içinden
    > "return gonderilecek header"
    > ve
    > ana.php içinden
    > $x = include("include.php");
    > header($x);
    >
    > kodunu (is,inize yarayacak ise) deneyebilirsiniz.
    >
    > Birde sorun include.php içinde bos,luklar olmas?ndan kaynaklanabilir.
    > Tabii böyle bir durumda "headers already sent" hatas? vermeli. Eg(er
    > sorunun bundan kaynakland?g(?n? düs,ünüyorsan?z output buffering deneyin.
    >
    > Onur Yalaz?
    >
    >


  • Next message: Sancar Saran: "[linux-programlama] Re: php dosyadan php yi cagirma header problemi"

    ---------

    Bu arsiv hypermail 2.1.6 tarafindan uretilmistir.