1
bradburn
images in PHP script
  • 2006/1/27 16:25

  • bradburn

  • Not too shy to talk

  • Posts: 105

  • Since: 2005/1/26


Hi there, (im a noob and cant code by the way)

I have some php script that works really well, but I would like to add a picture to it.

I tried this html code which works fine but it didnt work...
<IMG alt="Great Manchester Run" src="http://intranet/modules/news/images/wc2.gif" border=0>

Does any one know how i would add an image to this countdown script I found?

?>
<?
// enter target date below like this: "January 2, 2001"
$target = "July 10, 2006";

// enter string of what this start date is. $top_text appears above the counter, $bottom_text displays below the counter

$top_text = "There are ";
$bottom_text = "until Great Charity Run";

//--------------------------
$now = strtotime ("now");
$then = strtotime ("$target");
$difference = $then - $now;
$num = $difference/86400;
$days = intval($num);
$num2 = ($num - $days)*24;
$hours = intval($num2);
$num3 = ($num2 - $hours)*60;
$mins = intval($num3);
$num4 = ($num3 - $mins)*60;
?>
<div style="font-weight:bold;" align="center"> <? echo $top_text ?><br />
<table border="0" cellspacing="0" cellpadding="0" style="color:#00CC00;font-size:10px;font-family:'Courier New', Courier, mono;border-top:2px solid #AAAAAA;border-right:2px solid #333333;border-bottom:2px solid #333333;border-left:2px solid #AAAAAA;background-color:#FFF;padding:0px;width:125px;">
<tr align="center" valign="middle">
<td><? echo $days ?></td>
<td>:</td>
<td><? echo $hours ?></td>
<td>:</td>
<td><? echo $mins ?></td>
</tr>
<tr align="center" valign="middle">
<td>Days</td>
<td>|</td>
<td>Hrs</td>
<td>|</td>
<td>Mins</td>
</table>
<? echo $bottom_text ?> </div>
<?



Many thanks for any help!

2
Xeon_DP
Re: images in PHP script
  • 2006/1/27 19:01

  • Xeon_DP

  • Just popping in

  • Posts: 25

  • Since: 2005/12/11


1) The code isn't really correct, ur using ASP style <? ?>
should be more likely <?php ?>

2) to make an <img>, make sure it isn't between <? and ?>

Login

Who's Online

108 user(s) are online (49 user(s) are browsing Support Forums)


Members: 0


Guests: 108


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: May 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits