Re: Daily pic problem



<comp.lang.php>
<shror>
<Sat, 20 Sep 2008 06:04:48 -0700 (PDT)>
<cf906137-a3d6-49ff-83fd-1e03a76ee698@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>

I have tried the if
(file_exists ($photo)) and its also giving me the default image


Untested - but it should work .


<?php

$date=date("Y-m-d");

$rambo1="DailyPic/photos/thumbs/$date" . ".jpg";
$rambo2="DailyPic/photos/photos/$date" . ".jpg";

$batman1=$rambo1;
$batman2=$rambo2;

if (!file_exists($batman1))
{
$rambo1="DailyPic/photos/thumbs/default.jpg";
$rambo2="DailyPic/photos/photos/default.jpg";
}

if (!file_exists($batman2))
{
$rambo1="DailyPic/photos/thumbs/default.jpg";
$rambo2="DailyPic/photos/photos/default.jpg";
}

$xy=getimagesize($rambo1);

print "<div align=center>";
print "<a href=$rambo2>";
print "<img src=$rambo1 width=$xy[0] height=$xy[1] border=0>";
print "</a>";
print "</div>";

?>


--
www.phpguestbook.co.uk/phpgb
(the best php guestbook on planet earth)
.



Relevant Pages

  • Re: Daily pic problem
    ... shror wrote: ... am trying to create a php script that get a daily picture but am ... echo ""; ... JDS Computer Training Corp. ...
    (comp.lang.php)
  • Re: Quiz using php little problem
    ... shror wrote: ... i have a problem dealing with a quiz system in php. ... Read up on sessions in the PHP doc. ...
    (comp.lang.php)
  • Re: PHP counter for free
    ... shror wrote: ... generate a small piece of code and add it to his website and by this ... If you are new to PHP, I would advise you to use something like google analitics for your sites. ...
    (comp.lang.php)
  • Re: PHP counter for free
    ... shror wrote: ... generate a small piece of code and add it to his website and by this ... way they run their own counters for free ... I wrote a counter in php that counts unique ip addresses. ...
    (comp.lang.php)
  • Re: Colin McRae is dead!
    ... But i'm gonna put the php guestbook i'm writing on the ... www.cannabiswindow.co.uk website and as the CW website gets between ... the script not looking or functioning like it should. ... Perhaps sometime I should learn PHP and beat Krusty at his own game:) ...
    (uk.media.tv.misc)