You are here: Re: Can't Escape « PHP Programming Language « IT news, forums, messages
Re: Can't Escape

Posted by Michael Fesser on 09/11/07 21:50

..oO(Good Man)

>Confused but working on it <PostInGroups@wherever.com> wrote in
>news:2007091114413816807-PostInGroups@wherevercom:
>
>> <?php
>> //NOT WORKING - shows the little blue question mark box
>> echo "<img src = \"/DSC01351.jpg\">";
>
>This means: show an image, the source of which is at the top of the
>server. Perhaps you should put the entire path to the image, relative
>to where your PHP script is being called from.
>
>echo "<img src=\"path/to/my/image/DSC01351.jpg\">";

Additionally HTML also allows single quotes, which avoids the ugly
escaping:

echo "<img src='path/to/my/image/DSC01351.jpg'>";

>according to your script, the images are located in the directory
>"images". therefore, you need the directory name in addition to the
>image name. should be:
>
>echo "<img src=\"images/".$file."\" alt=\"my image\">";

echo "<img src='images/$file' alt='my image'>";

I find that much more readable.

Micha

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация