Hi,
I'm working on this project(game), I did all the code, but I can't tell if it is what required or not, because I failed to show the images that are stored in the array...
$allcards = array(
"cards/6_hearts.gif" , "cards/7_hearts.gif" , "cards/8_hearts.gif" , "cards/9_hearts.gif" , "cards/10_hearts.gif" , "cards/11_hearts.gif" , "cards/12_hearts.gif" , "cards/13_hearts.gif" , "cards/14_hearts.gif" ,
"cards/6_spades.gif" , "cards/7_spades.gif" , "cards/8_spades.gif" , "cards/9_spades.gif" , "cards/10_spades.gif" , "cards/11_spades.gif" , "cards/12_spades.gif" , "cards/13_spades.gif" , "cards/14_spades.gif" ,
"cards/6_diamonds.gif" , "cards/7_diamonds.gif" , "cards/8_diamonds.gif" , "cards/9_diamonds.gif" , "cards/10_diamonds.gif" , "cards/10_diamonds.gif" , "cards/11_diamonds.gif" , "cards/12_diamonds.gif" , "cards/13_diamonds.gif" , "cards/14_diamonds.gif" ,
"cards/6_clubs.gif" , "cards/7_clubs.gif" , "cards/8_clubs.gif" , "cards/9_clubs.gif" , "cards/10_clubs.gif" , "cards/11_clubs.gif" , "cards/12_clubs.gif" , "cards/13_clubs.gif" , "cards/14_clubs.gif");
$values = array(
"6" , "7" , "8" , "9" , "10" , "11" , "12" , "13" , "14" ,
"6" , "7" , "8" , "9" , "10" , "11" , "12" , "13" , "14" ,
"6" , "7" , "8" , "9" , "10" , "11" , "12" , "13" , "14" ,
"6" , "7" , "8" , "9" , "10" , "11" , "12" , "13" , "14" );
I call the functions:
if ($useraction == "deal"){
shufelmycards($mycards,$oponentcards);
startplaying();
print showcards($oponentcards,"dealershand","");
print showcards($mycards,"Myhand","My cards : $gamercount");
}
Now this is supposed to show the array output images inside a table, it shows the tables, it shows rows, but their is an X insted of images. All the images are in a folder called cards
function showcards($show,$title,$footer) {
global $allcards;
global $useraction;
$showcards .= "<table width='70%' background='gfx/black.gif' cellspacing=' 2' cellpadding='0' border='0'>
<tr><td valign='top'><TABLE width='100%' cellspacing='0' cellpadding='5' border='0'><TR><TD align='center' bgcolor='#000066'><img src=\"gfx/$title.gif\" alt='' border='0' align='top'></td></tr></table></td></tr>
<tr><td valign='top'><TABLE width='100%' cellspacing='0' cellpadding='5' border='0'><TR><TD align='center' bgcolor='#0066ff'>";
for($i=0; $i < 5; $i++) {
$card = $show[$i];
if ($useraction != "deal" && $title == "dealershand" && ($i == 0 || $i=1 || $i=2 or $i=3)) {
$showcards .= "<img src='cards/back.gif' width='71' height='96' alt='' border='0'> ";
} else {
$showcards .= "<img src=" . $allcards[$card] . " width='71' height='96' alt='' border='0'> ";
}
}
$showcards .= "<br>$footer</td></tr></table></td></tr></table><br>";
return $showcards;
}
Can you please help me finding out why it does not show any image??
Thanks a lot.