Re: Daily pic problem
- From: Jerry Stuckle <jstucklex@xxxxxxxxxxxxx>
- Date: Sat, 20 Sep 2008 08:45:07 -0400
shror wrote:
Hi every body,>>> switch ($photo){
am trying to create a php script that get a daily picture but am
having a problem with that,
here is the code am using:
<?php
$date = date("Y-m-d");
echo "";
$ext = ".jpg";
$photo = "/DailyPic/photos/thumbs/$date". $ext ;
switch ($photo){
case "file_exisits ($photo)":
echo "<a href='/DailyPic/photos/$date". $ext ."'>";
echo "<img src='";
echo "/DailyPic/photos/thumbs/$date". $ext ;
echo "'></a>";
break;
default:
echo "<a href='/DailyPic/photos/default.jpg'>";
echo "<img src='";
echo "/DailyPic/photos/thumbs/default.jpg";
echo "'></a>";
break;
}
?>
what I get is the default image only so I need some help please.
Thanks for and support given in advance
shror
>>>>> case "file_exisits ($photo)":
Doesn't work. $photo is a string (filename) and is not equal to the result from file_exists (true/false) value. And I think you had a typo in transcribing your code :-).
Why use a switch statement here, anyway? Just us
if (file_exists($photo)) ...
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@xxxxxxxxxxxxx
==================
.
- Follow-Ups:
- Re: Daily pic problem
- From: shror
- Re: Daily pic problem
- References:
- Daily pic problem
- From: shror
- Daily pic problem
- Prev by Date: Re: Daily pic problem
- Next by Date: Re: Daily pic problem
- Previous by thread: Re: Daily pic problem
- Next by thread: Re: Daily pic problem
- Index(es):
Relevant Pages
|