You are here: Re: PHP Image by Default « All PHP « IT news, forums, messages
Re: PHP Image by Default

Posted by Fred Atkinson on 08/28/07 03:21

On Mon, 27 Aug 2007 03:22:44 +0100, "peter" <submit@flexiwebhost.com>
wrote:

>
>> I need some help on revising a simple PHP script. The script
>> I currently have is:
>>
>> <?php
>> $image = getRandomImage(LL/');
>> echo "<img src='$image' height=90 width=120 alt='LL'>";
>> ?>
>>
>> The script looks in the subdirectory for a random image and
>> displays the one it chooses.
>>
>> What I want to do modify it for is so that if it doesn't find
>> an image in the subdirectory, that a default image (from the current
>> directory rather than the designated subdirectory) ) can be displayed
>> instead.
>
>and what does getRandomImage return if not image is found, does it return
>null, does it return an empty string etc.
>
>Once you find that out you simply do an if statement checking checking if it
>returned null or an empty string (or whatever else it may return)
>

It returns null, which brings up a blank image.



Fred

 

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

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