Re: Introduction and questions...

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Jason Pruim wrote:

...

>>     http://php.net/htmlentities
>>
> 
> Okay, So after this post I have 1 more before everyone throws the manual
> at me... So lets make this good, I added that as you suggested, but
> think I may have put the entries in the wrong place... As it sits right
> now the $imgHTML= string is above a while($filename = readdir($dir))
> statement with only the echo htmlentities($imgHTML,ENT_COMPAT); down in
> the actual if then statement.
> 
> I changed it from ENT_QUOTES to ENT_COMPAT because of wanting to be able
> to automatically pickup the file name for that particular photo and the
> way it is right now it has single quotes ' around the file name and I
> wanted it to leave those alone.

I don't follow what your saying here exactly - got an example?
given that you want to display the HTML within the page as if it were
plain text I'm pretty sure you want to turn every relevant character
into it's html entity equivelant

> 
> When I try and load the page this way, I see the image, and then it
> says: link info echo htmlentities($imgHTML, ENT_COMPAT); in the browser
> window. Obviously not what I'm hoping for... So is there a PHP for
> idiots manual I can look at and see what I'm doing wrong? :)
> 

the code is being output instead of being parsed and run.
php will only parse and run code that is between php 'tags'.

this means you'll need something like:

	link info: <?php echo htmlentities($imgHTML, ENT_COMPAT); ?>

...

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux