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
papasmurf
Forum Newbie
Posts: 4 Joined: Sun Feb 09, 2003 3:56 pm
Post
by papasmurf » Sun Feb 09, 2003 3:56 pm
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ї0] = "header1.jpg";
$headersї1] = "header2.jpg";
$headersї2] = "header3.jpg";
$headersї3] = "header4.jpg";
$header = mt_rand(0, 4);
$header_loc = $headersї$header];
?>
<img src="<?php $headersї'$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 » Sun Feb 09, 2003 4:19 pm
you need to echo the variables in the img src...e.g.
<? echo $headers['$header']; ?>