why doesn't this work?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
papasmurf
Forum Newbie
Posts: 4
Joined: Sun Feb 09, 2003 3:56 pm

why doesn't this work?

Post 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>
bionicdonkey
Forum Contributor
Posts: 132
Joined: Fri Jan 31, 2003 2:28 am
Location: Sydney, Australia
Contact:

Post by bionicdonkey »

you need to echo the variables in the img src...e.g.
<? echo $headers['$header']; ?>
Post Reply