Text on web page

Discussion in 'HTML' started by salonowiec, Mar 24, 2008.

  1. salonowiec

    salonowiec Guest

    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
     
    salonowiec, Mar 24, 2008
    #1
    1. Advertising

  2. salonowiec

    Neredbojias Guest

    On 24 Mar 2008, salonowiec <> 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 &gt;
    respectively.)

    --
    Neredbojias
    http://www.neredbojias.com/
    Great sights and sounds
     
    Neredbojias, Mar 24, 2008
    #2
    1. Advertising

  3. salonowiec

    Guest

    On Mar 24, 1:29 pm, salonowiec <> 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!
    > 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;
    ?>
     
    , Mar 24, 2008
    #3
  4. salonowiec

    salonowiec Guest

    U¿ytkownik "Neredbojias" <> napisa³ w wiadomo¶ci
    news:Xns9A6B5071F9E8Dneredbojiasnano@85.214.90.236...
    > On 24 Mar 2008, salonowiec <> 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 &gt;
    > respectively.)
    >
    > --
    > Neredbojias
    > http://www.neredbojias.com/
    > Great sights and sounds


    Entities, of course!... Many thanks.
     
    salonowiec, Mar 24, 2008
    #4
  5. salonowiec

    mrcakey Guest

    "salonowiec" <> wrote in message
    news:fs9020$7eb$...
    >
    > U¿ytkownik "Neredbojias" <> napisa³ w wiadomo¶ci
    > news:Xns9A6B5071F9E8Dneredbojiasnano@85.214.90.236...
    >> On 24 Mar 2008, salonowiec <> 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
    >> &gt;
    >> respectively.)
    >>
    >> --
    >> Neredbojias
    >> http://www.neredbojias.com/
    >> Great sights and sounds

    >
    > Entities, of course!... Many thanks.


    Really?!! That fixed it?

    +mrcakey
     
    mrcakey, Mar 24, 2008
    #5
  6. salonowiec

    dorayme Guest

    In article <Xns9A6B5071F9E8Dneredbojiasnano@85.214.90.236>,
    Neredbojias <> wrote:

    > On 24 Mar 2008, salonowiec <> 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 &gt;
    > respectively.)


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

    --
    dorayme
     
    dorayme, Mar 24, 2008
    #6
  7. salonowiec

    Neredbojias Guest

    On 24 Mar 2008, "salonowiec" <> 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 &gt; 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
     
    Neredbojias, Mar 24, 2008
    #7
  8. salonowiec

    Neredbojias Guest

    On 24 Mar 2008, dorayme <> 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 &gt; 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"...

    --
    Neredbojias
    http://www.neredbojias.com/
    Great sights and sounds
     
    Neredbojias, Mar 24, 2008
    #8
  9. salonowiec

    rf Guest

    "Neredbojias" <> wrote in message
    news:Xns9A6BA408C429neredbojiasnano@85.214.90.236...
    > On 24 Mar 2008, dorayme <> 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 &gt; 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.
     
    rf, Mar 25, 2008
    #9
  10. salonowiec

    Guest

    On Mar 24, 11:07 pm, Neredbojias <> wrote:
    > 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/language.types.string.php#language.types.string..syntax.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 :(
     
    , Mar 25, 2008
    #10
  11. salonowiec

    Neredbojias Guest

    On 24 Mar 2008, wrote:

    > On Mar 24, 11:07 pm, Neredbojias <> wrote:
    >> 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/language.types.string.php#language.types.s
    > tring.syntax.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 :(


    Okay, I grok it. Good explanation. I believe when I ran across it I
    decided I didn't want to do anything like that and so expunged it from my
    mind, but you (and rf) set me straight.

    --
    Neredbojias
    http://www.neredbojias.com/
    Great sights and sounds
     
    Neredbojias, Mar 25, 2008
    #11
  12. salonowiec

    mrcakey Guest

    "Neredbojias" <> wrote in message
    news:Xns9A6BA39965235neredbojiasnano@85.214.90.236...
    > On 24 Mar 2008, "salonowiec" <> 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 &gt; 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
     
    mrcakey, Mar 25, 2008
    #12
  13. salonowiec

    Neredbojias Guest

    On 25 Mar 2008, "mrcakey" <> wrote:

    > "Neredbojias" <> wrote in message
    >>>> 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 &gt; respectively.)

    >>
    >>> Entities, of course!... Many thanks.

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

    >
    > 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.


    I didn't think you were rude, just expressing doubts. If you _want_ to be
    rude, use phrases like "your code is broken", "stop wanting that", and some
    of the other gem cliches that float around here.

    I viewed the OP's problem from an html perspective, hence the disclaimer
    about <<<EOT.

    --
    Neredbojias
    http://www.neredbojias.com/
    Great sights and sounds
     
    Neredbojias, Mar 25, 2008
    #13
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Natty Gur
    Replies:
    0
    Views:
    2,598
    Natty Gur
    Jun 6, 2004
  2. =?Utf-8?B?VHJldm9yIEJlbmVkaWN0IFI=?=
    Replies:
    0
    Views:
    2,407
    =?Utf-8?B?VHJldm9yIEJlbmVkaWN0IFI=?=
    Jun 7, 2004
  3. Reny J Joseph Thuthikattu
    Replies:
    1
    Views:
    586
    =?Utf-8?B?UHJha2FzaC5ORVQ=?=
    Dec 30, 2004
  4. leo
    Replies:
    1
    Views:
    305
    Bob Lehmann
    Dec 5, 2005
  5. Replies:
    3
    Views:
    411
Loading...

Share This Page