Re: Set Variable = Long HTML String?
| From: | sit1way | Date: | Sat, 07 Oct 2006 15:53:21 +0000 |
| Subject: | Re: Set Variable = Long HTML String? | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-242798@lists.php.net to get a copy of this message | ||
Hey all.
I'm overhauling my PHP based CMS and want to know how to set a variable
equal to an HTML string, but without having to escape all the quotes!
Example:
$var = "<form name="events" method="POST" action="">
<select class="menus" name="news"
onChange="MM_jumpMenu('parent',this,0);">
<option selected>News Options</option>
<option value=<? echo $this->doc_path
?>admin/news/add/1/>Add</option>
<option value=<? echo $this->doc_path
?>admin/news/update/1/>Update</option>
<option value=<? echo $this->doc_path
?>admin/news/delete/1/>Delete</option>
</select>
</form>";
This will die due to all the unescaped strings, not to mention the <? echo
$this->doc_path ?> statements.
How to pull this off? I don't want to include the HTML snippets as they are
"sprinkled" throughout my classes.
TIA,
--Noah