Click to See Complete Forum and Search --> : php image


rbrown
12-18-2007, 07:50 AM
Hi can anyone help me fix this code? it just doesnt seem to work, i have to have the image expire on a particular day thanks.

i would prefer to fix this code rather than any alternatives, thanks

<td class="smheader" style="text-align: center;">
<?php
$now = time();
$expire = strtotime('2007-12-17 00:00:00');
if ($expire < $golive) {
echo '<a href="/globals/partnerurls/redirect.php?language=EN&amp;partner=TRIEST&amp;pos=TOURISTBOARDS_PAGE" target="_blank"><img src="/site/partners/img/touristboards/trieste.gif" width="200" height="110" border="0" /></a>';
} else {
return false;
}
?>
</td>

TheRave
12-18-2007, 08:03 AM
Where/how does the $golive variable get its value?

rbrown
12-18-2007, 08:12 AM
not entirely sure,

can you give me an example of the value it should have?

TheRave
12-18-2007, 08:21 AM
Umm, surely you should know, its your code.

Looking at the code:
It should be a time. A time relative to $expire. If $golive is greater than $expire then the image will be shown.

myanavrin
12-18-2007, 09:34 AM
try this one.


<td class="smheader" style="text-align: center;">
<?php
$exp = "2007-12-17";
$now = date("Y-m-d");
$today = strtotime($now);
$expire = strtotime($exp);
if ($expire > $today) {
echo '<a href="/globals/partnerurls/redirect.php?language=EN&amp;partner=TRIEST&amp;pos=TOURISTBOARDS_PAGE" target="_blank"><img src="/site/partners/img/touristboards/trieste.gif" width="200" height="110" border="0" /></a>';
} else {
return false;
}
?>
</td>

myanavrin
12-18-2007, 09:36 AM
just change the $exp value to what date you want the image to expire.