Re: file_get_contents

From: Date: Thu, 16 Nov 2006 15:49:21 +0000
Subject: Re: file_get_contents
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-244721@lists.php.net to get a copy of this message
Thanks Jochem, Tried that, but it's still showing php code in the text area! Any other ideas? The url is http://www.tnhosting.co.uk/scripts/gclub/updateplaylist.php and you see it on submission. Feel free to post. It's a testing server. On 16/11/06, Jochem Maas <jochem@iamjochem.com> wrote:
Tom Chubb wrote: I am trying to read the contents of a "PHP" page for an audio player and put it into a textarea to be copied and pasted into an "HTML" page. The trouble is the textarea shows unparsed PHP code and I just want the HTML. The code is: $player = file_get_contents('player.php'); file_get_content('http://blabla.com/player.php'); // requires allow_url_fopen to be set to On. //Strip out unnecessary HTML Code if(preg_match('/<!-- Start Player Code -->(.*)<!-- End Player Code -->/s', $player, $matches)) { $code = $matches[1]; } echo "<textarea name=\"textarea\" cols=\"70\" rows=\"15\">" . $code . htmlentities($code) "</textarea>"; echo "<BR>"; echo "<a href=\"player.php\">Click Here</a> to view the player \n"; Looked at using eval() but found this: Kepp the following Quote in mind: If eval() is the answer, you're almost certainly asking the wrong question. -- Rasmus Lerdorf, BDFL of PHP indeed eval is probably not the answer. (Hmmm...) Any help much appreciated. Tom
-- Tom Chubb tomchubb@gmail.com 07915 053312

« previous php.general (#244721) next »