Article View: pl.comp.lang.php
Article #231219Re: FCKeditor i buforowanie ob_start, ob_get_contents
From: koop
Date: Thu, 28 Jan 2016 11:34
Date: Thu, 28 Jan 2016 11:34
57 lines
2406 bytes
2406 bytes
plik.txt to tekst czy taki przyklad?
include sluzy do dolaczenia plikow php
jezeli chcesz wgrac zawartosc pliku tekstowego to wywolaj fn np.
$content = file_get_content('plik.txt');
Pozdrawiam
W dniu 28.01.2016 11:51, web pisze:
> walczę z fckeditor. Przed PHP 5.3 działało dobrze, później przestało.
>
> Wreszcie doszedłem, że przyczyna jest nieodpowiednie zachowanie buforowania ob_start(), ob_get_contents().
>
> poniżej kod, który sprawia problemy
>
> -----------------------------
> ob_start();
> include("plik.txt");
> $content = ob_get_contents();
> ob_end_clean();
>
> $oFCKeditor = new FCKeditor('EDYTOR') ;
> $oFCKeditor->BasePath = 'fckeditor/' ;
> $oFCKeditor->Height = '300' ;
> $oFCKeditor->width = '98%' ;
> $oFCKeditor->Value = $content ;
> $oFCKeditor->Create() ;
> ------------------------------------
>
>
> w PHP 5.3 i późniejsze do $content nie chce wchodzić include(readfile tez nie, require też nie)
>
> natomiast takie wyrazenie:
>
> -------------------------
> ob_start();
>
> echo "cos tam";
>
> // include("plik.txt");
> $content = ob_get_contents();
> ob_end_clean();
>
> ------------------------
>
> powoduje, ze "coś tam" pojawia się w $content.
>
> PYTANIE!
>
> Jak za pomocą include lub podobnej funkcji wrzucić zawartość pliku do $content, czyli ostatecznie wyświetlić w FCKEditor
>
> z góry pieknie dziekuje za pomoc
>
>
>
>
>
>
Technical Details
Message-ID:
<n8cucg$gm1$1@node2.news.atman.pl>Path:
mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.icm.edu.pl!news.nask.pl!news.nask.org.pl!newsfeed2.atman.pl!newsfeed.atman.pl!.POSTED!not-for-mailReferences:
<10a855bb-386c-4caa-8ebb-3880375a0cfd@googlegroups.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.icm.edu.pl!news.nask.pl!news.nask.org.pl!newsfeed2.atman.pl!newsfeed.atman.pl!.POSTED!not-for-mail From: koop <koop@o2.pl> Newsgroups: pl.comp.lang.php Subject: Re: FCKeditor i buforowanie ob_start, ob_get_contents Date: Thu, 28 Jan 2016 12:34:41 +0100 Organization: ATMAN - ATM S.A. Lines: 58 Message-ID: <n8cucg$gm1$1@node2.news.atman.pl> References: <10a855bb-386c-4caa-8ebb-3880375a0cfd@googlegroups.com> NNTP-Posting-Host: host-188-122-8-164.finemedia.pl Mime-Version: 1.0 X-Trace: node2.news.atman.pl 1453980881 17089 188.122.8.164 (28 Jan 2016 11:34:41 GMT) X-Complaints-To: usenet@atman.pl NNTP-Posting-Date: Thu, 28 Jan 2016 11:34:41 +0000 (UTC) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.3.0 In-Reply-To: <10a855bb-386c-4caa-8ebb-3880375a0cfd@googlegroups.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit