HighDots Forums  

Text on web page

alt.html alt.html


Discuss Text on web page in the alt.html forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
salonowiec
 
Posts: n/a

Default Text on web page - 03-24-2008 , 08:29 AM






I'd like to make something that seems absolutely simple: to put the
fragment of html code so that it will be seen for users and not
interpreted. For example:

$template_thumb_view_title_row = <<<EOT

<table width="100%" cellpadding="0"
cellspacing="0">
<tr>
<td width="100%"
class="statlink"><h2>{ALBUM_NAME}</h2></td>
<td><img src="images/spacer.gif"
width="1" alt="" /></td>
</tr>
</table>

EOT;

But computer makes the interpretation and part of the text disappears!
Thank you

Reply With Quote
  #2  
Old   
mynameisnobodyodyssea@googlemail.com
 
Posts: n/a

Default Re: Text on web page - 03-24-2008 , 01:50 PM






On Mar 24, 1:29*pm, salonowiec <boguslaw.kna... (AT) gmail (DOT) com> wrote:
Quote:
I'd like to make something that seems absolutely simple: to put the
fragment of html code so that it will be seen for users and not
interpreted. For example:

$template_thumb_view_title_row = <<<EOT

* * * * * * * * * * * * <table width="100%" cellpadding="0"
cellspacing="0"
* * * * * * * * * * * * <tr
* * * * * * * * * * * * * * * * <td width="100%"
class="statlink"><h2>{ALBUM_NAME}</h2></td
* * * * * * * * * * * * * * * * <td><img src="images/spacer.gif"
width="1" alt="" /></td
* * * * * * * * * * * * </tr
* * * * * * * * * * * * </table

EOT;

But computer makes the interpretation and part of the text disappears!
Thank you
This looks like a PHP heredoc string
that must be declared and then
printed to the browser (probably using echo)
within the <?php ... ?> tags,
for example

<?php
$template_thumb_view_title_row = <<<EOT
<table width="100%" cellpadding="0" cellspacing="0">
<tr>
<td width="100%"
class="statlink"><h2>{ALBUM_NAME}</h2></td>
<td><img src="images/spacer.gif"
width="1" alt="" /></td>
</tr>
</table>
EOT;

// ..... maybe something else here before printing ... and print

echo $template_thumb_view_title_row;
?>



Reply With Quote
  #3  
Old   
salonowiec
 
Posts: n/a

Default Re: Text on web page - 03-24-2008 , 02:39 PM




Użytkownik "Neredbojias" <example (AT) example (DOT) com> napisał w wiadomości
news:Xns9A6B5071F9E8Dneredbojiasnano (AT) 85 (DOT) 214.90.236...
Quote:
On 24 Mar 2008, salonowiec <boguslaw.knapik (AT) gmail (DOT) com> wrote:
I dunno what <<<EOT is but for the html you must use html entities for
certain characters like "<" and ">" (-which in this case are &lt; and
respectively.)

--
Neredbojias
http://www.neredbojias.com/
Great sights and sounds
Entities, of course!... Many thanks.



Reply With Quote
  #4  
Old   
mrcakey
 
Posts: n/a

Default Re: Text on web page - 03-24-2008 , 04:27 PM



"salonowiec" <debrza_remove (AT) poczta (DOT) onet.pl> wrote

Quote:
Użytkownik "Neredbojias" <example (AT) example (DOT) com> napisał w wiadomości
news:Xns9A6B5071F9E8Dneredbojiasnano (AT) 85 (DOT) 214.90.236...
On 24 Mar 2008, salonowiec <boguslaw.knapik (AT) gmail (DOT) com> wrote:
I dunno what <<<EOT is but for the html you must use html entities for
certain characters like "<" and ">" (-which in this case are &lt; and

respectively.)

--
Neredbojias
http://www.neredbojias.com/
Great sights and sounds

Entities, of course!... Many thanks.
Really?!! That fixed it?

+mrcakey




Reply With Quote
  #5  
Old   
dorayme
 
Posts: n/a

Default Re: Text on web page - 03-24-2008 , 04:40 PM



In article <Xns9A6B5071F9E8Dneredbojiasnano (AT) 85 (DOT) 214.90.236>,
Neredbojias <example (AT) example (DOT) com> wrote:

Quote:
On 24 Mar 2008, salonowiec <boguslaw.knapik (AT) gmail (DOT) com> wrote:

I'd like to make something that seems absolutely simple: to put the
fragment of html code so that it will be seen for users and not
interpreted. For example:

$template_thumb_view_title_row = <<<EOT

table width="100%" cellpadding="0"
cellspacing="0"
tr
td width="100%"
class="statlink"><h2>{ALBUM_NAME}</h2></td
td><img src="images/spacer.gif"
width="1" alt="" /></td
/tr
/table

EOT;

But computer makes the interpretation and part of the text disappears!

I dunno what <<<EOT is but for the html you must use html entities for
certain characters like "<" and ">" (-which in this case are &lt; and
respectively.)
And look up the "code" element, you might find it useful.

--
dorayme


Reply With Quote
  #6  
Old   
rf
 
Posts: n/a

Default Re: Text on web page - 03-24-2008 , 07:15 PM




"Neredbojias" <example (AT) example (DOT) com> wrote

Quote:
On 24 Mar 2008, dorayme <doraymeRidThis (AT) optusnet (DOT) com.au> wrote:

But computer makes the interpretation and part of the text
disappears!

I dunno what <<<EOT is but for the html you must use html entities
for certain characters like "<" and ">" (-which in this case are &lt;
and > respectively.)

And look up the "code" element, you might find it useful.

Okay. I've run across Heredoc references before but know zilch about it.
Perhaps it's something like "pre"...
It's PHP.

--
Richard.




Reply With Quote
  #7  
Old   
mynameisnobodyodyssea@googlemail.com
 
Posts: n/a

Default Re: Text on web page - 03-24-2008 , 07:31 PM



On Mar 24, 11:07*pm, Neredbojias <exam... (AT) example (DOT) com> wrote:
Quote:
Okay. *I've run across Heredoc references before but know zilch about it.. *
Perhaps it's something like "pre"...
herodoc syntax is for declaring strings in PHP (or Perl)
for PHP see
http://www.php.net/manual/en/languag... yntax.heredoc

If the question was about printing as HTML
to the browser an example with the text
of a PHP script, then escaping the angle brackets as
&lt; or &gt; as you suggested would of course help with printing the
whole text.

I thought the question was about a different thing,
about declaring a string variable in
PHP and printing it to the browser later,
but I do not know the context in which that code is used



Reply With Quote
  #8  
Old   
mrcakey
 
Posts: n/a

Default Re: Text on web page - 03-25-2008 , 04:53 AM



"Neredbojias" <example (AT) example (DOT) com> wrote

Quote:
On 24 Mar 2008, "salonowiec" <debrza_remove (AT) poczta (DOT) onet.pl> wrote:

I dunno what <<<EOT is but for the html you must use html entities
for certain characters like "<" and ">" (-which in this case are &lt;
and > respectively.)

Entities, of course!... Many thanks.

'Welcome. Er, did it work? Subsequent posters seem to be expressing
doubts.

--
Neredbojias
http://www.neredbojias.com/
Great sights and sounds
Sorry, didn't mean to be rude. In all my experience with PHP I've never had
an issue outputting < and > as is so I was surprised that 'fixed' OP's
issue - looked to me like they'd not enclosed code in PHP tags or maybe
tried to run it on a non-PHP server.

+mrcakey




Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.