note 90806 rejected from function.htmlentities by thiago
| From: | thiago@php.net | Date: | Mon, 11 May 2009 12:24:29 +0000 |
| Subject: | note 90806 rejected from function.htmlentities by thiago | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-154437@lists.php.net to get a copy of this message | ||
Note Submitter: testing_guru at indiatimes dot com
----
I have a strange problem and not sure where to list it. But I guess the best location is under
"htmlentities"...
I have 2 pages. One first page, I am taking some HTML input from the user with the help of
FCKEditor. The input contains HTML code, something similar to this:
<p>Enter your content in this box. You can also copy-paste directly from MS
Word.</p><p><img height="293" alt="" width="676"
src="Identify%20personalities%20small.JPG" /></p><table
cellspacing="1" cellpadding="1" width="200"
border="1"><tbody><tr><td
colspan="2"><strong><span style="font-family: Verdana">Heading
1</span></strong></td><td><strong><span style="font-family:
Verdana">Heading 2</span></strong></td></tr><tr><td>Cell
1</td><td>Cell 2</td><td>Cell
3</td></tr></tbody></table><p><span style="font-family:
Tahoma"><strong><span style="background-color: #ccffff">Shaded
row</span></strong></span></p>
I am passing above input as a parameter to a URL and then reading this parameter in my second page:
echo "Original: ".$_GET['message']."<br><br>";
$originalBody = htmlentities($_GET['message'], ENT_QUOTES);
echo "1st conversion: ".$originalBody."<br><br>";
$emailBody = '';
$emailBody = substr($originalBody, 1,
strpos($originalBody,");','','scrollbars=")-1);
echo "2nd conversion: ".$emailBody;
However, the output suddenly gets stripped off at the # in the "<span
style="background-color: #ccffff">" statement. I have also tried putting the # at
the beginning and have found that the output is nothing! I really don't know why the output is
being stripped of at the #...
I have tried many combinations but still am unable to find a solution. Please help urgently - email
would be appreciated. For more clarifications, please email me. Thanks!