Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > Text on web page

Reply
Thread Tools

Text on web page

 
 
salonowiec
Guest
Posts: n/a
 
      03-24-2008
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
 
 
 
 
Neredbojias
Guest
Posts: n/a
 
      03-24-2008
On 24 Mar 2008, salonowiec <(E-Mail Removed)> 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
 
Reply With Quote
 
 
 
 
mynameisnobodyodyssea@googlemail.com
Guest
Posts: n/a
 
      03-24-2008
On Mar 24, 1:29*pm, salonowiec <(E-Mail Removed)> 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;
?>

 
Reply With Quote
 
salonowiec
Guest
Posts: n/a
 
      03-24-2008

Użytkownik "Neredbojias" <(E-Mail Removed)> napisał w wiadomości
news:Xns9A6B5071F9E8Dneredbojiasnano@85.214.90.236 ...
> On 24 Mar 2008, salonowiec <(E-Mail Removed)> 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.

 
Reply With Quote
 
mrcakey
Guest
Posts: n/a
 
      03-24-2008
"salonowiec" <(E-Mail Removed)> wrote in message
news:fs9020$7eb$(E-Mail Removed)...
>
> Użytkownik "Neredbojias" <(E-Mail Removed)> napisał w wiadomości
> news:Xns9A6B5071F9E8Dneredbojiasnano@85.214.90.236 ...
>> On 24 Mar 2008, salonowiec <(E-Mail Removed)> 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


 
Reply With Quote
 
dorayme
Guest
Posts: n/a
 
      03-24-2008
In article <Xns9A6B5071F9E8Dneredbojiasnano@85.214.90.236>,
Neredbojias <(E-Mail Removed)> wrote:

> On 24 Mar 2008, salonowiec <(E-Mail Removed)> 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
 
Reply With Quote
 
Neredbojias
Guest
Posts: n/a
 
      03-24-2008
On 24 Mar 2008, "salonowiec" <(E-Mail Removed)> 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
 
Reply With Quote
 
Neredbojias
Guest
Posts: n/a
 
      03-24-2008
On 24 Mar 2008, dorayme <(E-Mail Removed)> 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
 
Reply With Quote
 
rf
Guest
Posts: n/a
 
      03-25-2008

"Neredbojias" <(E-Mail Removed)> wrote in message
news:Xns9A6BA408C429neredbojiasnano@85.214.90.236. ..
> On 24 Mar 2008, dorayme <(E-Mail Removed)> 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.


 
Reply With Quote
 
mynameisnobodyodyssea@googlemail.com
Guest
Posts: n/a
 
      03-25-2008
On Mar 24, 11:07*pm, Neredbojias <(E-Mail Removed)> 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/languag...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

 
Reply With Quote
 
 
 
Reply

Thread Tools

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to update the current web page? (delete current web page + rewrite the page) laryten@yahoo.com Javascript 3 10-12-2006 07:33 PM
Controlling text in a Text Area or Text leo ASP General 1 12-05-2005 01:13 AM
accessing the web user control's control from a web page and set a value from another web page Reny J Joseph Thuthikattu ASP .Net 1 12-30-2004 12:21 PM
RE: Web page is not available - "The Web page you requested is not available offline. To view this page, click Connect" =?Utf-8?B?VHJldm9yIEJlbmVkaWN0IFI=?= ASP .Net 0 06-07-2004 07:11 AM
Re: Web page is not available - "The Web page you requested is not available offline. To view this page, click Connect" Natty Gur ASP .Net 0 06-06-2004 05:46 AM



Advertisments