Need a safe way to get user supplied data into a varaible.
| From: | Simon Coggins | Date: | Mon, 09 Jun 2003 00:15:57 +0000 |
| Subject: | Need a safe way to get user supplied data into a varaible. | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-150687@lists.php.net to get a copy of this message | ||
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
--
Simon Coggins (SAGE-AU Member) Email: simon@uow.edu.au
Network and System Management Officer Phone: +61-2-4221-3775
Information Technology Systems (ITS) Mobile: 0408 115861
University of Wollongong, 2522, Australia Fax: +61-2-4229-1985