Page 1 of 1

why doesn't this work?

Posted: Sun Feb 09, 2003 3:56 pm
by papasmurf
both images show as "not available"...
what's wrong with this? im guessing the array of file names but i dunno how to fix...

Code: Select all

<html>
<body>
<?php

$headers&#1111;0] = "header1.jpg";
$headers&#1111;1] = "header2.jpg";
$headers&#1111;2] = "header3.jpg";
$headers&#1111;3] = "header4.jpg";

$header = mt_rand(0, 4);
$header_loc = $headers&#1111;$header];

?>

<img src="<?php $headers&#1111;'$header']; ?>">
<img src="<?php $header_loc; ?>">
</body>
</html>

Posted: Sun Feb 09, 2003 4:19 pm
by bionicdonkey
you need to echo the variables in the img src...e.g.
<? echo $headers['$header']; ?>