Re: Need a safe way to get user supplied data into a varaible.

From: Date: Mon, 09 Jun 2003 00:38:03 +0000
Subject: Re: Need a safe way to get user supplied data into a varaible.
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-150689@lists.php.net to get a copy of this message
Why not just use file() and friends? Simon Coggins wrote:
Hi, After lots of looking I've worked out I can't use heredoc for what I want. Does anyone else have any better ideas on how to do this: I have a template file that is used to generate a html page. in this template I currently have: $body = <<<EOF possibly any type of text as it's an email message body EOF; I then do some operations on this text and print out the result. My problem is that heredoc parses variables, so if the email happends to contain a string that looks like or is php variables it all goes wrong. Plus it means someone could intentionaly start echoing variables. I need some way of putting a block of text into a variable without having to read it in from a file. From the template point of view, all that happends is a token is replaced with the body of the text. So reading that in from a file is hard. Thanks
-- The above message is encrypted with double rot13 encoding. Any unauthorized attempt to decrypt it will be prosecuted to the full extent of the law.

« previous php.general (#150689) next »