peterisgb Posted November 25, 2014 Posted November 25, 2014 (edited) I'll be using this same thread for problems i have been hitting while building this game, looking for help or pointers. More info on this site can be found here. http://makewebgames.io/showthread.php/45280-New-Game-Partner-or-Helper-Required Edited December 2, 2014 by peterisgb Quote
Sim Posted November 25, 2014 Posted November 25, 2014 global $user_id, $con; inside your function? Quote
peterisgb Posted November 25, 2014 Author Posted November 25, 2014 global $user_id, $con; inside your function? Yup. in the db file. Quote
KyleMassacre Posted November 25, 2014 Posted November 25, 2014 Sim means to add that to your functions. For example: function someFunction() { global $user_id, $con; //the rest here } Quote
peterisgb Posted November 25, 2014 Author Posted November 25, 2014 Sim means to add that to your functions. For example: function someFunction() { global $user_id, $con; //the rest here } oh right, wouldnt i need to globalize the $user_id and the $con first in the db file, if so i havent done that and not sure how. Quote
KyleMassacre Posted November 25, 2014 Posted November 25, 2014 No you only need to use global for variables that are not defined in that function. If they are outside the function globalize it, if they are in an include globalize it Quote
peterisgb Posted November 25, 2014 Author Posted November 25, 2014 No you only need to use global for variables that are not defined in that function. If they are outside the function globalize it, if they are in an include globalize it ok well how would i go about globalizing the $con and $user_id. Quote
peterisgb Posted November 25, 2014 Author Posted November 25, 2014 the keyword "global" i've tried the using the global function and it doesnt work, it dont throw up no errors, just a blank page. Quote
peterisgb Posted November 28, 2014 Author Posted November 28, 2014 I've got it now lol, Thanks for the pointers. Instead of starting a new thread i'll post my new wall. I have got Map locations $x and $y (0,0) map. I have created a 11,11 table, now the next part is how do i put the user onto it. and get it to move around the grid and find things and buildings etc, how would i go forward on this. the move part does work, its just the map to go. Quote
NonStopCoding Posted November 28, 2014 Posted November 28, 2014 So you want to add the users to the map table? example x = 11 y = 11 user = 0 Quote
peterisgb Posted November 28, 2014 Author Posted November 28, 2014 (edited) So you want to add the users to the map table? example x = 11 y = 11 user = 0 erm, think so maybe, user is 0,0 or 5,-2 for location, the table would be a map that would show a picture at a X, X location like a city, and you travel to the location the table would show your user moving to that location on the table. Does that make sense? http://makewebgames.io/showthread.php/45280-New-Game-Partner-or-Helper-Required Link to the details for link and demo account details. I work live so you can see more clearly. Edited November 28, 2014 by peterisgb Quote
NonStopCoding Posted November 28, 2014 Posted November 28, 2014 whats your sql structure for maps like? if it is something like above use the $userid or $ir['userid'] variables to update the maps when the user moves for example Your Map Location: 2, 2, You have 93 left. ok so in maps it would look something like this (well this is how i would do it) Location x Location y user each map would have its own location and a available user slot so user moves north from 2,2 which would be 3,2 i would do a check to see if that slot is empty if so then add the users id into it if not then some action like a fight or something for adding the users id to the table there is two ways it can be done both need to be global in the function $res = $db->query("SELECT `user` FROM `maps`"); while($r = $db->fetch_row($res)) { if(empty($r['user'])) { $db->query("UPDATE `maps` SET `user` = '$userid' WHERE `user` = 0"); } else { some action like fight } } Keeping this in mind you will need to remove the users id on move as well Quote
peterisgb Posted November 28, 2014 Author Posted November 28, 2014 (edited) There isnt one, The locations for the cities and random things are done php side, my mysqli are skills are lacking abit, doing if locationx and locationy = 1,1 do city etc. First part of the map page <?php include "header.php"; $action = ( array_key_exists( 'action', $_GET) ? $_GET['action'] : "" ); switch ($action) { case 'moven': do_move1_north(); break; case 'movew': do_move1_west(); break; case 'movee': do_move1_east(); break; case 'moves': do_move1_south(); break; case 'search1': do_search1_ad(); break; case 'search2': do_search2_ad(); break; default: echo " <br /> <h2>Travel</h2> Here you travel around the map to find army or people to fight with.<br /><br /> <table width='75%'> <tr><td></td> <td align='center'> Your Map Location: <font color='blue' size='3'> <font color='red'>".$locationx."</font>, <font color='green'>".$locationy."</font>, You have <font color='black'>".$moves."</font> left.</font><br /><small>(Map Is currently out of action.)</small> </td><tr> <tr><td align='center' valign='top' width='100'> "; echo "<hr />Misc"; $x1 = rand(1,40); $y1 = rand(1,40); $x2 = rand(10,50); $y2 = rand(10,50); if (($locationx == 0) && ($locationy == 0)) { echo "<h3>Home City<br /> <a href='city.php'><u>Enter City</u></a><br /></h3>"; } if (($locationx == $x1) && ($locationy == $y1)) { echo "<h3>Hmm.. Whats that?<br /> <a href='move.php?action=search1'><u>Check it Out</u></a><br /></h3>"; } if (($locationx == $x2) && ($locationy == $y2)) { echo "<h3>Hmm.. Whats that?<br /> <a href='move.php?action=search2'><u>Check it Out</u></a><br /></h3>"; } echo "<hr />"; if ($moves <= 0) { echo "No Moves, Nav Disabled"; } else { echo " <table> <tr> <td></td> <td></td> <td align='center'><font color='red'><b>N</b></font></td> <td></td> <td></td> </tr> <tr> <td></td> <td></td> <td align='center'><a href='move.php?action=moven'><img src='/images/up.png'></a></td> <td></td> <td></td> </tr> <tr> <td><font color='green'><b>W</b></font></td> <td align='center'><a href='move.php?action=movew'><img src='/images/left.png'></a></td> <td align='center'><b>+</b></td> <td align='center'><a href='move.php?action=movee'><img src='/images/right.png'></a></td> <td><font color='green'><b>E</b></font></td> </tr> <tr> <td></td> <td></td> <td align='center'><a href='move.php?action=moves'><img src='/images/down.png'></a></td> <td></td> <td></td> </tr> <tr> <td></td> <td></td> <td align='center'><font color='red'><b>S</b></font></td> <td></td> <td></td> </tr> </table>"; } echo "</td><td width='600' align='center'> <table style='background: url(/images/grass.jpg)' border='1' width='275px' height='275px'> <tr width='25' height='25'> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='5,-5'></td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='5,-4'></td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='5,-3'></td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='5,-2'></td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='5,-1'></td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='5,0'></td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='5,1'></td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='5,2'></td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='5,3'></td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='5,4'></td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='5,5'></td> </tr> <tr width='25' height='25'> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='4,-5'></td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='4,-4'></td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='4,-3'></td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='4,-2'></td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='4,-1'></td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='4,0'></td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='4,1'></td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='4,2'></td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='4,3'></td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='4,4'></td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='4,5'></td> </tr> <tr width='25' height='25'> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='3,-5'></td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='3,-4'></td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='3,-3'></td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='3,-2'></td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='3,-1'></td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='3,0'></td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='3,1'></td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='3,2'></td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='3,3'></td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='3,4'></td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='3,5'></td> </tr> <tr width='25' height='25'> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='2,-5'></td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='2,-4'></td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='2,-3'></td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='2,-2'></td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='2,-1'></td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='2,0'></td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='2,1'></td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='2,2'></td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='2,3'></td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='2,4'></td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='2,5'></td> </tr> <tr width='25' height='25'> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='1,-5'></td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='1,-4'></td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='1,-3'></td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='1,-2'></td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='1,-1'></td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='1,0'></td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='1,1'></td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='1,2'></td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='1,3'></td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='1,4'></td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='1,5'></td> </tr> <tr width='25' height='25'> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='0,-5'></td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='0,-4'></td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='0,-3'></td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='0,-2'></td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='0,-1'></td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='0,0'><img src='/images/maincity.png' width='19' height='19'></td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='0,1'></td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='0,2'></td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='0,3'></td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='0,4'></td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='0,5'></td> </tr> <tr width='25' height='25'> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='-1,-5'></td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='-1,-4'></td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='-1,-3'></td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='-1,-2'></td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='-1,-1'></td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='-1,0'></td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='-1,1'></td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='-1,2'></td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='-1,3'></td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='-1,4'></td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='-1,5'></td> </tr> <tr width='25' height='25'> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='-2,-5'></td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='-2,-4'></td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='-2,-3'></td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='-2,-2'></td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='-2,-1'></td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='-2,0'></td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='-2,1'></td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='-2,2'></td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='-2,3'></td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='-2,4'></td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='-2,5'></td> </tr> <tr width='25' height='25'> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='-3,-5'></td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='-3,-4'></td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='-3,-3'></td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='-3,-2'></td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='-3,-1'></td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='-3,0'></td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='-3,1'></td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='-3,2'></td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='-3,3'></td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='-3,4'></td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='-3,5'></td> </tr> <tr width='25' height='25'> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='-4,-5'></td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='-4,-4'></td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='-4,-3'></td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='-4,-2'></td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='-4,-1'></td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='-4,0'></td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='-4,1'></td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='-4,2'></td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='-4,3'></td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='-4,4'></td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='-4,5'></td> </tr> <tr width='25' height='25'> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='-5,-5'></td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='-5,-4'></td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='-5,-3'></td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='-5,-2'></td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='-5,-1'></td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='-5,0'></td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='-5,1'></td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='-5,2'></td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='-5,3'></td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='-5,4'></td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='-5,5'></td> </tr> </table> </td></tr> </table>"; } part of the move function do_move1_south() { $session=$_SESSION['email']; $con = mysqli_connect('localhost','user','pass',db'); $query="UPDATE users SET locationx=locationx-1, moves=moves-1 WHERE user_email='$session'"; if(mysqli_query($con, $query)) { echo "Moved South<br /><script>window.open('move.php','main')</script>"; } } Edited November 28, 2014 by peterisgb Quote
KyleMassacre Posted November 28, 2014 Posted November 28, 2014 You need to look into the GD library Quote
peterisgb Posted November 28, 2014 Author Posted November 28, 2014 You need to look into the GD library Thanks, not much on that site means anything to me. Quote
KyleMassacre Posted November 28, 2014 Posted November 28, 2014 Everything GD means everything to you in regards to what you are attempting to do. The GD lib allows you to manipulate images the way you need to and layer images on other images like you are asking to do GD Lib Quote
peterisgb Posted November 29, 2014 Author Posted November 29, 2014 (edited) Everything GD means everything to you in regards to what you are attempting to do. The GD lib allows you to manipulate images the way you need to and layer images on other images like you are asking to do GD Lib Ok, well i dont suppose anyone could help me with this or help me understand and teach me how i could do this? Edited December 1, 2014 by peterisgb Quote
peterisgb Posted December 1, 2014 Author Posted December 1, 2014 This is what i have so far. It works and you can move etc, but it surely could be easier? $you="<img src='/images/punk.jpg' width='20' height='20'>"; if (($locationx == '0') && ($locationy == '0')) { $plocation00="".$you.""; } else { $plocation00=""; } if (($locationx == '0') && ($locationy == '1')) { $plocation01="".$you.""; } else { $plocation01=""; } if (($locationx == '0') && ($locationy == '2')) { $plocation02="".$you.""; } else { $plocation02=""; } if (($locationx == '0') && ($locationy == '3')) { $plocation03="".$you.""; } else { $plocation03=""; } if (($locationx == '0') && ($locationy == '4')) { $plocation04="".$you.""; } else { $plocation04=""; } if (($locationx == '0') && ($locationy == '5')) { $plocation05="".$you.""; } else { $plocation05=""; } if (($locationx == '0') && ($locationy == '6')) { $plocation06="".$you.""; } else { $plocation06=""; } if (($locationx == '0') && ($locationy == '7')) { $plocation07="".$you.""; } else { $plocation07=""; } if (($locationx == '0') && ($locationy == '8')) { $plocation08="".$you.""; } else { $plocation08=""; } if (($locationx == '0') && ($locationy == '9')) { $plocation09="".$you.""; } else { $plocation09=""; } if (($locationx == '0') && ($locationy == '10')) { $plocation010="".$you.""; } else { $plocation010=""; } if (($locationx == '1') && ($locationy == '0')) { $plocation10="".$you.""; } else { $plocation10=""; } if (($locationx == '1') && ($locationy == '1')) { $plocation11="".$you.""; } else { $plocation11=""; } if (($locationx == '1') && ($locationy == '2')) { $plocation12="".$you.""; } else { $plocation12=""; } if (($locationx == '1') && ($locationy == '3')) { $plocation13="".$you.""; } else { $plocation13=""; } if (($locationx == '1') && ($locationy == '4')) { $plocation14="".$you.""; } else { $plocation14=""; } if (($locationx == '1') && ($locationy == '5')) { $plocation15="".$you.""; } else { $plocation15=""; } if (($locationx == '1') && ($locationy == '6')) { $plocation16="".$you.""; } else { $plocation16=""; } if (($locationx == '1') && ($locationy == '7')) { $plocation17="".$you.""; } else { $plocation17=""; } if (($locationx == '1') && ($locationy == '8')) { $plocation18="".$you.""; } else { $plocation18=""; } if (($locationx == '1') && ($locationy == '9')) { $plocation19="".$you.""; } else { $plocation19=""; } if (($locationx == '1') && ($locationy == '10')) { $plocation110="".$you.""; } else { $plocation110=""; } if (($locationx == '2') && ($locationy == '0')) { $plocation20="".$you.""; } else { $plocation20=""; } if (($locationx == '2') && ($locationy == '1')) { $plocation21="".$you.""; } else { $plocation21=""; } if (($locationx == '2') && ($locationy == '2')) { $plocation22="".$you.""; } else { $plocation22=""; } if (($locationx == '2') && ($locationy == '3')) { $plocation23="".$you.""; } else { $plocation23=""; } if (($locationx == '2') && ($locationy == '4')) { $plocation24="".$you.""; } else { $plocation24=""; } if (($locationx == '2') && ($locationy == '5')) { $plocation25="".$you.""; } else { $plocation25=""; } if (($locationx == '2') && ($locationy == '6')) { $plocation26="".$you.""; } else { $plocation26=""; } if (($locationx == '2') && ($locationy == '7')) { $plocation27="".$you.""; } else { $plocation27=""; } if (($locationx == '2') && ($locationy == '8')) { $plocation28="".$you.""; } else { $plocation28=""; } if (($locationx == '2') && ($locationy == '9')) { $plocation29="".$you.""; } else { $plocation29=""; } if (($locationx == '2') && ($locationy == '10')) { $plocation210="".$you.""; } else { $plocation210=""; } if (($locationx == '3') && ($locationy == '0')) { $plocation30="".$you.""; } else { $plocation30=""; } if (($locationx == '3') && ($locationy == '1')) { $plocation31="".$you.""; } else { $plocation31=""; } if (($locationx == '3') && ($locationy == '2')) { $plocation32="".$you.""; } else { $plocation32=""; } if (($locationx == '3') && ($locationy == '3')) { $plocation33="".$you.""; } else { $plocation33=""; } if (($locationx == '3') && ($locationy == '4')) { $plocation34="".$you.""; } else { $plocation34=""; } if (($locationx == '3') && ($locationy == '5')) { $plocation35="".$you.""; } else { $plocation35=""; } if (($locationx == '3') && ($locationy == '6')) { $plocation36="".$you.""; } else { $plocation36=""; } if (($locationx == '3') && ($locationy == '7')) { $plocation37="".$you.""; } else { $plocation37=""; } if (($locationx == '3') && ($locationy == '8')) { $plocation38="".$you.""; } else { $plocation38=""; } if (($locationx == '3') && ($locationy == '9')) { $plocation39="".$you.""; } else { $plocation39=""; } if (($locationx == '3') && ($locationy == '10')) { $plocation310="".$you.""; } else { $plocation310=""; } if (($locationx == '4') && ($locationy == '0')) { $plocation40="".$you.""; } else { $plocation40=""; } if (($locationx == '4') && ($locationy == '1')) { $plocation41="".$you.""; } else { $plocation41=""; } if (($locationx == '4') && ($locationy == '2')) { $plocation42="".$you.""; } else { $plocation42=""; } if (($locationx == '4') && ($locationy == '3')) { $plocation43="".$you.""; } else { $plocation43=""; } if (($locationx == '4') && ($locationy == '4')) { $plocation44="".$you.""; } else { $plocation44=""; } if (($locationx == '4') && ($locationy == '5')) { $plocation45="".$you.""; } else { $plocation45=""; } if (($locationx == '4') && ($locationy == '6')) { $plocation46="".$you.""; } else { $plocation46=""; } if (($locationx == '4') && ($locationy == '7')) { $plocation47="".$you.""; } else { $plocation47=""; } if (($locationx == '4') && ($locationy == '8')) { $plocation48="".$you.""; } else { $plocation48=""; } if (($locationx == '4') && ($locationy == '9')) { $plocation49="".$you.""; } else { $plocation49=""; } if (($locationx == '4') && ($locationy == '10')) { $plocation410="".$you.""; } else { $plocation410=""; } if (($locationx == '5') && ($locationy == '0')) { $plocation50="".$you.""; } else { $plocation50=""; } if (($locationx == '5') && ($locationy == '1')) { $plocation51="".$you.""; } else { $plocation51=""; } if (($locationx == '5') && ($locationy == '2')) { $plocation52="".$you.""; } else { $plocation52=""; } if (($locationx == '5') && ($locationy == '3')) { $plocation53="".$you.""; } else { $plocation53=""; } if (($locationx == '5') && ($locationy == '4')) { $plocation54="".$you.""; } else { $plocation54=""; } if (($locationx == '5') && ($locationy == '5')) { $plocation55="".$you.""; } else { $plocation55=""; } if (($locationx == '5') && ($locationy == '6')) { $plocation56="".$you.""; } else { $plocation56=""; } if (($locationx == '5') && ($locationy == '7')) { $plocation57="".$you.""; } else { $plocation57=""; } if (($locationx == '5') && ($locationy == '8')) { $plocation58="".$you.""; } else { $plocation58=""; } if (($locationx == '5') && ($locationy == '9')) { $plocation59="".$you.""; } else { $plocation59=""; } if (($locationx == '5') && ($locationy == '10')) { $plocation510="".$you.""; } else { $plocation510=""; } if (($locationx == '6') && ($locationy == '0')) { $plocation60="".$you.""; } else { $plocation60=""; } if (($locationx == '6') && ($locationy == '1')) { $plocation61="".$you.""; } else { $plocation61=""; } if (($locationx == '6') && ($locationy == '2')) { $plocation62="".$you.""; } else { $plocation62=""; } if (($locationx == '6') && ($locationy == '3')) { $plocation63="".$you.""; } else { $plocation63=""; } if (($locationx == '6') && ($locationy == '4')) { $plocation64="".$you.""; } else { $plocation64=""; } if (($locationx == '6') && ($locationy == '5')) { $plocation65="".$you.""; } else { $plocation65=""; } if (($locationx == '6') && ($locationy == '6')) { $plocation66="".$you.""; } else { $plocation66=""; } if (($locationx == '6') && ($locationy == '7')) { $plocation67="".$you.""; } else { $plocation67=""; } if (($locationx == '6') && ($locationy == '8')) { $plocation68="".$you.""; } else { $plocation68=""; } if (($locationx == '6') && ($locationy == '9')) { $plocation69="".$you.""; } else { $plocation69=""; } if (($locationx == '6') && ($locationy == '10')) { $plocation610="".$you.""; } else { $plocation610=""; } if (($locationx == '7') && ($locationy == '0')) { $plocation70="".$you.""; } else { $plocation70=""; } if (($locationx == '7') && ($locationy == '1')) { $plocation71="".$you.""; } else { $plocation71=""; } if (($locationx == '7') && ($locationy == '2')) { $plocation72="".$you.""; } else { $plocation72=""; } if (($locationx == '7') && ($locationy == '3')) { $plocation73="".$you.""; } else { $plocation73=""; } if (($locationx == '7') && ($locationy == '4')) { $plocation74="".$you.""; } else { $plocation74=""; } if (($locationx == '7') && ($locationy == '5')) { $plocation75="".$you.""; } else { $plocation75=""; } if (($locationx == '7') && ($locationy == '6')) { $plocation76="".$you.""; } else { $plocation76=""; } if (($locationx == '7') && ($locationy == '7')) { $plocation77="".$you.""; } else { $plocation77=""; } if (($locationx == '7') && ($locationy == '8')) { $plocation78="".$you.""; } else { $plocation78=""; } if (($locationx == '7') && ($locationy == '9')) { $plocation79="".$you.""; } else { $plocation79=""; } if (($locationx == '7') && ($locationy == '10')) { $plocation710="".$you.""; } else { $plocation710=""; } if (($locationx == '8') && ($locationy == '0')) { $plocation80="".$you.""; } else { $plocation80=""; } if (($locationx == '8') && ($locationy == '1')) { $plocation81="".$you.""; } else { $plocation81=""; } if (($locationx == '8') && ($locationy == '2')) { $plocation82="".$you.""; } else { $plocation82=""; } if (($locationx == '8') && ($locationy == '3')) { $plocation83="".$you.""; } else { $plocation83=""; } if (($locationx == '8') && ($locationy == '4')) { $plocation84="".$you.""; } else { $plocation84=""; } if (($locationx == '8') && ($locationy == '5')) { $plocation85="".$you.""; } else { $plocation85=""; } if (($locationx == '8') && ($locationy == '6')) { $plocation86="".$you.""; } else { $plocation86=""; } if (($locationx == '8') && ($locationy == '7')) { $plocation87="".$you.""; } else { $plocation87=""; } if (($locationx == '8') && ($locationy == '8')) { $plocation88="".$you.""; } else { $plocation88=""; } if (($locationx == '8') && ($locationy == '9')) { $plocation89="".$you.""; } else { $plocation89=""; } if (($locationx == '8') && ($locationy == '10')) { $plocation810="".$you.""; } else { $plocation810=""; } if (($locationx == '9') && ($locationy == '0')) { $plocation90="".$you.""; } else { $plocation90=""; } if (($locationx == '9') && ($locationy == '1')) { $plocation91="".$you.""; } else { $plocation91=""; } if (($locationx == '9') && ($locationy == '2')) { $plocation92="".$you.""; } else { $plocation92=""; } if (($locationx == '9') && ($locationy == '3')) { $plocation93="".$you.""; } else { $plocation93=""; } if (($locationx == '9') && ($locationy == '4')) { $plocation94="".$you.""; } else { $plocation94=""; } if (($locationx == '9') && ($locationy == '5')) { $plocation95="".$you.""; } else { $plocation95=""; } if (($locationx == '9') && ($locationy == '6')) { $plocation96="".$you.""; } else { $plocation96=""; } if (($locationx == '9') && ($locationy == '7')) { $plocation97="".$you.""; } else { $plocation97=""; } if (($locationx == '9') && ($locationy == '8')) { $plocation98="".$you.""; } else { $plocation98=""; } if (($locationx == '9') && ($locationy == '9')) { $plocation99="".$you.""; } else { $plocation99=""; } if (($locationx == '9') && ($locationy == '10')) { $plocation910="".$you.""; } else { $plocation910=""; } if (($locationx == '10') && ($locationy == '0')) { $plocation100="".$you.""; } else { $plocation100=""; } if (($locationx == '10') && ($locationy == '1')) { $plocation101="".$you.""; } else { $plocation101=""; } if (($locationx == '10') && ($locationy == '2')) { $plocation102="".$you.""; } else { $plocation102=""; } if (($locationx == '10') && ($locationy == '3')) { $plocation103="".$you.""; } else { $plocation103=""; } if (($locationx == '10') && ($locationy == '4')) { $plocation104="".$you.""; } else { $plocation104=""; } if (($locationx == '10') && ($locationy == '5')) { $plocation105="".$you.""; } else { $plocation105=""; } if (($locationx == '10') && ($locationy == '6')) { $plocation106="".$you.""; } else { $plocation106=""; } if (($locationx == '10') && ($locationy == '7')) { $plocation107="".$you.""; } else { $plocation107=""; } if (($locationx == '10') && ($locationy == '8')) { $plocation108="".$you.""; } else { $plocation108=""; } if (($locationx == '10') && ($locationy == '9')) { $plocation109="".$you.""; } else { $plocation109=""; } if (($locationx == '10') && ($locationy == '10')) { $plocation1010="".$you.""; } else { $plocation1010=""; } echo " <table style='background: url(/images/grass.jpg)' border='1' width='275px' height='275px'> <tr width='25' height='25'> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='10,0' align='center'>".$plocation100."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='10,1' align='center'>".$plocation101."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='10,2' align='center'>".$plocation102."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='10,3' align='center'>".$plocation103."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='10,4' align='center'>".$plocation104."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='10,5' align='center'>".$plocation105."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='10,6' align='center'>".$plocation106."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='10,7' align='center'>".$plocation107."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='10,8' align='center'>".$plocation108."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='10,9' align='center'>".$plocation109."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='10,10' align='center'>".$plocation1010."</td> </tr> <tr width='25' height='25'> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='9,0' align='center'>".$plocation90."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='9,1' align='center'>".$plocation91."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='9,2' align='center'>".$plocation92."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='9,3' align='center'>".$plocation93."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='9,4' align='center'>".$plocation94."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='9,5' align='center'>".$plocation95."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='9,6' align='center'>".$plocation96."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='9,7' align='center'>".$plocation97."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='9,8' align='center'>".$plocation98."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='9,9' align='center'>".$plocation99."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='9,10' align='center'>".$plocation910."</td> </tr> <tr width='25' height='25'> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='8,0' align='center'>".$plocation80."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='8,1' align='center'>".$plocation81."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='8,2' align='center'>".$plocation82."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='8,3' align='center'>".$plocation83."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='8,4' align='center'>".$plocation84."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='8,5' align='center'>".$plocation85."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='8,6' align='center'>".$plocation86."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='8,7' align='center'>".$plocation87."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='8,8' align='center'>".$plocation88."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='8,9' align='center'>".$plocation89."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='8,10' align='center'>".$plocation810."</td> </tr> <tr width='25' height='25'> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='7,0' align='center'>".$plocation70."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='7,1' align='center'>".$plocation71."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='7,2' align='center'>".$plocation72."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='7,3' align='center'>".$plocation73."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='7,4' align='center'>".$plocation74."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='7,5' align='center'>".$plocation75."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='7,6' align='center'>".$plocation76."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='7,7' align='center'>".$plocation77."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='7,8' align='center'>".$plocation78."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='7,9' align='center'>".$plocation79."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='7,10' align='center'>".$plocation710."</td> </tr> <tr width='25' height='25'> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='6,0' align='center'>".$plocation60."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='6,1' align='center'>".$plocation61."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='6,2' align='center'>".$plocation62."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='6,3' align='center'>".$plocation63."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='6,4' align='center'>".$plocation64."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='6,5' align='center'>".$plocation65."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='6,6' align='center'>".$plocation66."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='6,7' align='center'>".$plocation67."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='6,8' align='center'>".$plocation68."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='6,9' align='center'>".$plocation69."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='6,10' align='center'>".$plocation610."</td> </tr> <tr width='25' height='25'> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='5,0' align='center'>".$plocation50."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='5,1' align='center'>".$plocation51."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='5,2' align='center'>".$plocation52."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='5,3' align='center'>".$plocation53."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='5,4' align='center'>".$plocation54."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='5,5' align='center'><img src='/images/pub.png' width='20' height='20'>".$plocation55."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='5,6' align='center'>".$plocation56."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='5,7' align='center'>".$plocation57."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='5,8' align='center'>".$plocation58."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='5,9' align='center'>".$plocation59."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='5,10' align='center'>".$plocation510."</td> </tr> <tr width='25' height='25'> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='4,0' align='center'>".$plocation40."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='4,1' align='center'>".$plocation41."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='4,2' align='center'>".$plocation42."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='4,3' align='center'>".$plocation43."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='4,4' align='center'>".$plocation44."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='4,5' align='center'>".$plocation45."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='4,6' align='center'>".$plocation46."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='4,7' align='center'>".$plocation47."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='4,8' align='center'>".$plocation48."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='4,9' align='center'>".$plocation49."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='4,10' align='center'>".$plocation410."</td> </tr> <tr width='25' height='25'> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='3,0' align='center'>".$plocation30."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='3,1' align='center'>".$plocation31."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='3,2' align='center'>".$plocation32."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='3,3' align='center'>".$plocation33."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='3,4' align='center'>".$plocation34."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='3,5' align='center'>".$plocation35."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='3,6' align='center'>".$plocation36."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='3,7' align='center'>".$plocation37."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='3,8' align='center'>".$plocation38."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='3,9' align='center'>".$plocation39."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='3,10' align='center'>".$plocation310."</td> </tr> <tr width='25' height='25'> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='2,0' align='center'>".$plocation20."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='2,1' align='center'>".$plocation21."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='2,2' align='center'>".$plocation22."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='2,3' align='center'>".$plocation23."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='2,4' align='center'>".$plocation24."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='2,5' align='center'>".$plocation25."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='2,6' align='center'>".$plocation26."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='2,7' align='center'>".$plocation27."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='2,8' align='center'>".$plocation28."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='2,9' align='center'>".$plocation29."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='2,10' align='center'>".$plocation210."</td> </tr> <tr width='25' height='25'> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='1,0' align='center'>".$plocation10."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='1,1' align='center'>".$plocation11."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='1,2' align='center'>".$plocation12."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='1,3' align='center'>".$plocation13."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='1,4' align='center'>".$plocation14."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='1,5' align='center'>".$plocation15."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='1,6' align='center'>".$plocation16."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='1,7' align='center'>".$plocation17."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='1,8' align='center'>".$plocation18."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='1,9' align='center'>".$plocation19."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='1,10' align='center'>".$plocation110."</td> </tr> <tr width='25' height='25'> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='0,0' align='center'><img src='/images/city.png' width='20' height='20'>".$plocation00."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='0,1' align='center'>".$plocation01."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='0,2' align='center'>".$plocation02."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='0,3' align='center'>".$plocation03."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='0,4' align='center'>".$plocation04."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='0,5' align='center'>".$plocation05."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='0,6' align='center'>".$plocation06."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='0,7' align='center'>".$plocation07."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='0,8' align='center'>".$plocation08."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='0,9' align='center'>".$plocation09."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='0,10' align='center'>".$plocation010."</td> </tr> </table> </td></tr> </table>"; } Quote
SHPXLBH Posted December 1, 2014 Posted December 1, 2014 This is what i have so far. It works and you can move etc, but it surely could be easier? $you="<img src='/images/punk.jpg' width='20' height='20'>"; if (($locationx == '0') && ($locationy == '0')) { $plocation00="".$you.""; } else { $plocation00=""; } if (($locationx == '0') && ($locationy == '1')) { $plocation01="".$you.""; } else { $plocation01=""; } if (($locationx == '0') && ($locationy == '2')) { $plocation02="".$you.""; } else { $plocation02=""; } if (($locationx == '0') && ($locationy == '3')) { $plocation03="".$you.""; } else { $plocation03=""; } if (($locationx == '0') && ($locationy == '4')) { $plocation04="".$you.""; } else { $plocation04=""; } if (($locationx == '0') && ($locationy == '5')) { $plocation05="".$you.""; } else { $plocation05=""; } if (($locationx == '0') && ($locationy == '6')) { $plocation06="".$you.""; } else { $plocation06=""; } if (($locationx == '0') && ($locationy == '7')) { $plocation07="".$you.""; } else { $plocation07=""; } if (($locationx == '0') && ($locationy == '8')) { $plocation08="".$you.""; } else { $plocation08=""; } if (($locationx == '0') && ($locationy == '9')) { $plocation09="".$you.""; } else { $plocation09=""; } if (($locationx == '0') && ($locationy == '10')) { $plocation010="".$you.""; } else { $plocation010=""; } if (($locationx == '1') && ($locationy == '0')) { $plocation10="".$you.""; } else { $plocation10=""; } if (($locationx == '1') && ($locationy == '1')) { $plocation11="".$you.""; } else { $plocation11=""; } if (($locationx == '1') && ($locationy == '2')) { $plocation12="".$you.""; } else { $plocation12=""; } if (($locationx == '1') && ($locationy == '3')) { $plocation13="".$you.""; } else { $plocation13=""; } if (($locationx == '1') && ($locationy == '4')) { $plocation14="".$you.""; } else { $plocation14=""; } if (($locationx == '1') && ($locationy == '5')) { $plocation15="".$you.""; } else { $plocation15=""; } if (($locationx == '1') && ($locationy == '6')) { $plocation16="".$you.""; } else { $plocation16=""; } if (($locationx == '1') && ($locationy == '7')) { $plocation17="".$you.""; } else { $plocation17=""; } if (($locationx == '1') && ($locationy == '8')) { $plocation18="".$you.""; } else { $plocation18=""; } if (($locationx == '1') && ($locationy == '9')) { $plocation19="".$you.""; } else { $plocation19=""; } if (($locationx == '1') && ($locationy == '10')) { $plocation110="".$you.""; } else { $plocation110=""; } if (($locationx == '2') && ($locationy == '0')) { $plocation20="".$you.""; } else { $plocation20=""; } if (($locationx == '2') && ($locationy == '1')) { $plocation21="".$you.""; } else { $plocation21=""; } if (($locationx == '2') && ($locationy == '2')) { $plocation22="".$you.""; } else { $plocation22=""; } if (($locationx == '2') && ($locationy == '3')) { $plocation23="".$you.""; } else { $plocation23=""; } if (($locationx == '2') && ($locationy == '4')) { $plocation24="".$you.""; } else { $plocation24=""; } if (($locationx == '2') && ($locationy == '5')) { $plocation25="".$you.""; } else { $plocation25=""; } if (($locationx == '2') && ($locationy == '6')) { $plocation26="".$you.""; } else { $plocation26=""; } if (($locationx == '2') && ($locationy == '7')) { $plocation27="".$you.""; } else { $plocation27=""; } if (($locationx == '2') && ($locationy == '8')) { $plocation28="".$you.""; } else { $plocation28=""; } if (($locationx == '2') && ($locationy == '9')) { $plocation29="".$you.""; } else { $plocation29=""; } if (($locationx == '2') && ($locationy == '10')) { $plocation210="".$you.""; } else { $plocation210=""; } if (($locationx == '3') && ($locationy == '0')) { $plocation30="".$you.""; } else { $plocation30=""; } if (($locationx == '3') && ($locationy == '1')) { $plocation31="".$you.""; } else { $plocation31=""; } if (($locationx == '3') && ($locationy == '2')) { $plocation32="".$you.""; } else { $plocation32=""; } if (($locationx == '3') && ($locationy == '3')) { $plocation33="".$you.""; } else { $plocation33=""; } if (($locationx == '3') && ($locationy == '4')) { $plocation34="".$you.""; } else { $plocation34=""; } if (($locationx == '3') && ($locationy == '5')) { $plocation35="".$you.""; } else { $plocation35=""; } if (($locationx == '3') && ($locationy == '6')) { $plocation36="".$you.""; } else { $plocation36=""; } if (($locationx == '3') && ($locationy == '7')) { $plocation37="".$you.""; } else { $plocation37=""; } if (($locationx == '3') && ($locationy == '8')) { $plocation38="".$you.""; } else { $plocation38=""; } if (($locationx == '3') && ($locationy == '9')) { $plocation39="".$you.""; } else { $plocation39=""; } if (($locationx == '3') && ($locationy == '10')) { $plocation310="".$you.""; } else { $plocation310=""; } if (($locationx == '4') && ($locationy == '0')) { $plocation40="".$you.""; } else { $plocation40=""; } if (($locationx == '4') && ($locationy == '1')) { $plocation41="".$you.""; } else { $plocation41=""; } if (($locationx == '4') && ($locationy == '2')) { $plocation42="".$you.""; } else { $plocation42=""; } if (($locationx == '4') && ($locationy == '3')) { $plocation43="".$you.""; } else { $plocation43=""; } if (($locationx == '4') && ($locationy == '4')) { $plocation44="".$you.""; } else { $plocation44=""; } if (($locationx == '4') && ($locationy == '5')) { $plocation45="".$you.""; } else { $plocation45=""; } if (($locationx == '4') && ($locationy == '6')) { $plocation46="".$you.""; } else { $plocation46=""; } if (($locationx == '4') && ($locationy == '7')) { $plocation47="".$you.""; } else { $plocation47=""; } if (($locationx == '4') && ($locationy == '8')) { $plocation48="".$you.""; } else { $plocation48=""; } if (($locationx == '4') && ($locationy == '9')) { $plocation49="".$you.""; } else { $plocation49=""; } if (($locationx == '4') && ($locationy == '10')) { $plocation410="".$you.""; } else { $plocation410=""; } if (($locationx == '5') && ($locationy == '0')) { $plocation50="".$you.""; } else { $plocation50=""; } if (($locationx == '5') && ($locationy == '1')) { $plocation51="".$you.""; } else { $plocation51=""; } if (($locationx == '5') && ($locationy == '2')) { $plocation52="".$you.""; } else { $plocation52=""; } if (($locationx == '5') && ($locationy == '3')) { $plocation53="".$you.""; } else { $plocation53=""; } if (($locationx == '5') && ($locationy == '4')) { $plocation54="".$you.""; } else { $plocation54=""; } if (($locationx == '5') && ($locationy == '5')) { $plocation55="".$you.""; } else { $plocation55=""; } if (($locationx == '5') && ($locationy == '6')) { $plocation56="".$you.""; } else { $plocation56=""; } if (($locationx == '5') && ($locationy == '7')) { $plocation57="".$you.""; } else { $plocation57=""; } if (($locationx == '5') && ($locationy == '8')) { $plocation58="".$you.""; } else { $plocation58=""; } if (($locationx == '5') && ($locationy == '9')) { $plocation59="".$you.""; } else { $plocation59=""; } if (($locationx == '5') && ($locationy == '10')) { $plocation510="".$you.""; } else { $plocation510=""; } if (($locationx == '6') && ($locationy == '0')) { $plocation60="".$you.""; } else { $plocation60=""; } if (($locationx == '6') && ($locationy == '1')) { $plocation61="".$you.""; } else { $plocation61=""; } if (($locationx == '6') && ($locationy == '2')) { $plocation62="".$you.""; } else { $plocation62=""; } if (($locationx == '6') && ($locationy == '3')) { $plocation63="".$you.""; } else { $plocation63=""; } if (($locationx == '6') && ($locationy == '4')) { $plocation64="".$you.""; } else { $plocation64=""; } if (($locationx == '6') && ($locationy == '5')) { $plocation65="".$you.""; } else { $plocation65=""; } if (($locationx == '6') && ($locationy == '6')) { $plocation66="".$you.""; } else { $plocation66=""; } if (($locationx == '6') && ($locationy == '7')) { $plocation67="".$you.""; } else { $plocation67=""; } if (($locationx == '6') && ($locationy == '8')) { $plocation68="".$you.""; } else { $plocation68=""; } if (($locationx == '6') && ($locationy == '9')) { $plocation69="".$you.""; } else { $plocation69=""; } if (($locationx == '6') && ($locationy == '10')) { $plocation610="".$you.""; } else { $plocation610=""; } if (($locationx == '7') && ($locationy == '0')) { $plocation70="".$you.""; } else { $plocation70=""; } if (($locationx == '7') && ($locationy == '1')) { $plocation71="".$you.""; } else { $plocation71=""; } if (($locationx == '7') && ($locationy == '2')) { $plocation72="".$you.""; } else { $plocation72=""; } if (($locationx == '7') && ($locationy == '3')) { $plocation73="".$you.""; } else { $plocation73=""; } if (($locationx == '7') && ($locationy == '4')) { $plocation74="".$you.""; } else { $plocation74=""; } if (($locationx == '7') && ($locationy == '5')) { $plocation75="".$you.""; } else { $plocation75=""; } if (($locationx == '7') && ($locationy == '6')) { $plocation76="".$you.""; } else { $plocation76=""; } if (($locationx == '7') && ($locationy == '7')) { $plocation77="".$you.""; } else { $plocation77=""; } if (($locationx == '7') && ($locationy == '8')) { $plocation78="".$you.""; } else { $plocation78=""; } if (($locationx == '7') && ($locationy == '9')) { $plocation79="".$you.""; } else { $plocation79=""; } if (($locationx == '7') && ($locationy == '10')) { $plocation710="".$you.""; } else { $plocation710=""; } if (($locationx == '8') && ($locationy == '0')) { $plocation80="".$you.""; } else { $plocation80=""; } if (($locationx == '8') && ($locationy == '1')) { $plocation81="".$you.""; } else { $plocation81=""; } if (($locationx == '8') && ($locationy == '2')) { $plocation82="".$you.""; } else { $plocation82=""; } if (($locationx == '8') && ($locationy == '3')) { $plocation83="".$you.""; } else { $plocation83=""; } if (($locationx == '8') && ($locationy == '4')) { $plocation84="".$you.""; } else { $plocation84=""; } if (($locationx == '8') && ($locationy == '5')) { $plocation85="".$you.""; } else { $plocation85=""; } if (($locationx == '8') && ($locationy == '6')) { $plocation86="".$you.""; } else { $plocation86=""; } if (($locationx == '8') && ($locationy == '7')) { $plocation87="".$you.""; } else { $plocation87=""; } if (($locationx == '8') && ($locationy == '8')) { $plocation88="".$you.""; } else { $plocation88=""; } if (($locationx == '8') && ($locationy == '9')) { $plocation89="".$you.""; } else { $plocation89=""; } if (($locationx == '8') && ($locationy == '10')) { $plocation810="".$you.""; } else { $plocation810=""; } if (($locationx == '9') && ($locationy == '0')) { $plocation90="".$you.""; } else { $plocation90=""; } if (($locationx == '9') && ($locationy == '1')) { $plocation91="".$you.""; } else { $plocation91=""; } if (($locationx == '9') && ($locationy == '2')) { $plocation92="".$you.""; } else { $plocation92=""; } if (($locationx == '9') && ($locationy == '3')) { $plocation93="".$you.""; } else { $plocation93=""; } if (($locationx == '9') && ($locationy == '4')) { $plocation94="".$you.""; } else { $plocation94=""; } if (($locationx == '9') && ($locationy == '5')) { $plocation95="".$you.""; } else { $plocation95=""; } if (($locationx == '9') && ($locationy == '6')) { $plocation96="".$you.""; } else { $plocation96=""; } if (($locationx == '9') && ($locationy == '7')) { $plocation97="".$you.""; } else { $plocation97=""; } if (($locationx == '9') && ($locationy == '8')) { $plocation98="".$you.""; } else { $plocation98=""; } if (($locationx == '9') && ($locationy == '9')) { $plocation99="".$you.""; } else { $plocation99=""; } if (($locationx == '9') && ($locationy == '10')) { $plocation910="".$you.""; } else { $plocation910=""; } if (($locationx == '10') && ($locationy == '0')) { $plocation100="".$you.""; } else { $plocation100=""; } if (($locationx == '10') && ($locationy == '1')) { $plocation101="".$you.""; } else { $plocation101=""; } if (($locationx == '10') && ($locationy == '2')) { $plocation102="".$you.""; } else { $plocation102=""; } if (($locationx == '10') && ($locationy == '3')) { $plocation103="".$you.""; } else { $plocation103=""; } if (($locationx == '10') && ($locationy == '4')) { $plocation104="".$you.""; } else { $plocation104=""; } if (($locationx == '10') && ($locationy == '5')) { $plocation105="".$you.""; } else { $plocation105=""; } if (($locationx == '10') && ($locationy == '6')) { $plocation106="".$you.""; } else { $plocation106=""; } if (($locationx == '10') && ($locationy == '7')) { $plocation107="".$you.""; } else { $plocation107=""; } if (($locationx == '10') && ($locationy == '8')) { $plocation108="".$you.""; } else { $plocation108=""; } if (($locationx == '10') && ($locationy == '9')) { $plocation109="".$you.""; } else { $plocation109=""; } if (($locationx == '10') && ($locationy == '10')) { $plocation1010="".$you.""; } else { $plocation1010=""; } echo " <table style='background: url(/images/grass.jpg)' border='1' width='275px' height='275px'> <tr width='25' height='25'> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='10,0' align='center'>".$plocation100."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='10,1' align='center'>".$plocation101."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='10,2' align='center'>".$plocation102."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='10,3' align='center'>".$plocation103."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='10,4' align='center'>".$plocation104."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='10,5' align='center'>".$plocation105."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='10,6' align='center'>".$plocation106."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='10,7' align='center'>".$plocation107."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='10,8' align='center'>".$plocation108."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='10,9' align='center'>".$plocation109."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='10,10' align='center'>".$plocation1010."</td> </tr> <tr width='25' height='25'> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='9,0' align='center'>".$plocation90."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='9,1' align='center'>".$plocation91."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='9,2' align='center'>".$plocation92."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='9,3' align='center'>".$plocation93."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='9,4' align='center'>".$plocation94."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='9,5' align='center'>".$plocation95."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='9,6' align='center'>".$plocation96."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='9,7' align='center'>".$plocation97."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='9,8' align='center'>".$plocation98."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='9,9' align='center'>".$plocation99."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='9,10' align='center'>".$plocation910."</td> </tr> <tr width='25' height='25'> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='8,0' align='center'>".$plocation80."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='8,1' align='center'>".$plocation81."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='8,2' align='center'>".$plocation82."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='8,3' align='center'>".$plocation83."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='8,4' align='center'>".$plocation84."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='8,5' align='center'>".$plocation85."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='8,6' align='center'>".$plocation86."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='8,7' align='center'>".$plocation87."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='8,8' align='center'>".$plocation88."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='8,9' align='center'>".$plocation89."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='8,10' align='center'>".$plocation810."</td> </tr> <tr width='25' height='25'> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='7,0' align='center'>".$plocation70."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='7,1' align='center'>".$plocation71."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='7,2' align='center'>".$plocation72."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='7,3' align='center'>".$plocation73."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='7,4' align='center'>".$plocation74."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='7,5' align='center'>".$plocation75."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='7,6' align='center'>".$plocation76."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='7,7' align='center'>".$plocation77."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='7,8' align='center'>".$plocation78."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='7,9' align='center'>".$plocation79."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='7,10' align='center'>".$plocation710."</td> </tr> <tr width='25' height='25'> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='6,0' align='center'>".$plocation60."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='6,1' align='center'>".$plocation61."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='6,2' align='center'>".$plocation62."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='6,3' align='center'>".$plocation63."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='6,4' align='center'>".$plocation64."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='6,5' align='center'>".$plocation65."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='6,6' align='center'>".$plocation66."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='6,7' align='center'>".$plocation67."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='6,8' align='center'>".$plocation68."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='6,9' align='center'>".$plocation69."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='6,10' align='center'>".$plocation610."</td> </tr> <tr width='25' height='25'> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='5,0' align='center'>".$plocation50."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='5,1' align='center'>".$plocation51."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='5,2' align='center'>".$plocation52."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='5,3' align='center'>".$plocation53."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='5,4' align='center'>".$plocation54."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='5,5' align='center'><img src='/images/pub.png' width='20' height='20'>".$plocation55."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='5,6' align='center'>".$plocation56."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='5,7' align='center'>".$plocation57."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='5,8' align='center'>".$plocation58."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='5,9' align='center'>".$plocation59."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='5,10' align='center'>".$plocation510."</td> </tr> <tr width='25' height='25'> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='4,0' align='center'>".$plocation40."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='4,1' align='center'>".$plocation41."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='4,2' align='center'>".$plocation42."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='4,3' align='center'>".$plocation43."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='4,4' align='center'>".$plocation44."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='4,5' align='center'>".$plocation45."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='4,6' align='center'>".$plocation46."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='4,7' align='center'>".$plocation47."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='4,8' align='center'>".$plocation48."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='4,9' align='center'>".$plocation49."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='4,10' align='center'>".$plocation410."</td> </tr> <tr width='25' height='25'> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='3,0' align='center'>".$plocation30."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='3,1' align='center'>".$plocation31."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='3,2' align='center'>".$plocation32."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='3,3' align='center'>".$plocation33."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='3,4' align='center'>".$plocation34."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='3,5' align='center'>".$plocation35."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='3,6' align='center'>".$plocation36."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='3,7' align='center'>".$plocation37."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='3,8' align='center'>".$plocation38."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='3,9' align='center'>".$plocation39."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='3,10' align='center'>".$plocation310."</td> </tr> <tr width='25' height='25'> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='2,0' align='center'>".$plocation20."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='2,1' align='center'>".$plocation21."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='2,2' align='center'>".$plocation22."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='2,3' align='center'>".$plocation23."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='2,4' align='center'>".$plocation24."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='2,5' align='center'>".$plocation25."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='2,6' align='center'>".$plocation26."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='2,7' align='center'>".$plocation27."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='2,8' align='center'>".$plocation28."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='2,9' align='center'>".$plocation29."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='2,10' align='center'>".$plocation210."</td> </tr> <tr width='25' height='25'> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='1,0' align='center'>".$plocation10."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='1,1' align='center'>".$plocation11."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='1,2' align='center'>".$plocation12."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='1,3' align='center'>".$plocation13."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='1,4' align='center'>".$plocation14."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='1,5' align='center'>".$plocation15."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='1,6' align='center'>".$plocation16."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='1,7' align='center'>".$plocation17."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='1,8' align='center'>".$plocation18."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='1,9' align='center'>".$plocation19."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='1,10' align='center'>".$plocation110."</td> </tr> <tr width='25' height='25'> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='0,0' align='center'><img src='/images/city.png' width='20' height='20'>".$plocation00."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='0,1' align='center'>".$plocation01."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='0,2' align='center'>".$plocation02."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='0,3' align='center'>".$plocation03."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='0,4' align='center'>".$plocation04."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='0,5' align='center'>".$plocation05."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='0,6' align='center'>".$plocation06."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='0,7' align='center'>".$plocation07."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='0,8' align='center'>".$plocation08."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='0,9' align='center'>".$plocation09."</td> <td style='background: url(/images/grass.jpg)' border='1' width='20' height='20' id='0,10' align='center'>".$plocation010."</td> </tr> </table> </td></tr> </table>"; } Yes. A much easier way. I'll give you a hint; <?php $a = array(); for($x = 0; $x <= 10; $x++) { $a[$x] = array(); for($y = 0; $y <= 10; $y++) { $a[$x][$y] = ''; } } $my_x = 5; $my_y = 2; $a[$my_x][$my_y] = 'HERE I AM'; print_r($a); Arrays are your friend. No need to have 100 of unique variables. Quote
peterisgb Posted December 1, 2014 Author Posted December 1, 2014 Yes. A much easier way. I'll give you a hint; <?php $a = array(); for($x = 0; $x <= 10; $x++) { $a[$x] = array(); for($y = 0; $y <= 10; $y++) { $a[$x][$y] = ''; } } $my_x = 5; $my_y = 2; $a[$my_x][$my_y] = 'HERE I AM'; print_r($a); Arrays are your friend. No need to have 100 of unique variables. Ok, very very new to arrays $a = array(); for($x = 0; $x <= 10; $x++) { $a[$x] = array(); for($y = 0; $y <= 10; $y++) { $a[$x][$y] = "<img src='/images/grassn.jpg' width='20' height='20'>"; } } $my_x = $locationx; $my_y = $locationy; $a[$my_x][$my_y] = "<img src='/images/punk.jpg' width='20' height='20'>"; print_r($a); Something like that? with that only thing thats wrong is shows array [0] =>image [1] => how is that displayed and hidden. also where would the <br /> go after the array? sorry newbs to arrays. Quote
peterisgb Posted December 1, 2014 Author Posted December 1, 2014 Consider http://ideone.com/6YbewY Thanks, easier to understand, but not quite sure how to figure out where to place things in one location aka, location of the city is location 0,0, so how would i sit that into the grid into one location? Quote
Alan Posted December 1, 2014 Posted December 1, 2014 $map[0][0] = CITY; Of course, you would have had to define CITY before hand, and add an element in the $image array for the city itself. Quote
peterisgb Posted December 1, 2014 Author Posted December 1, 2014 $map[0][0] = CITY; Of course, you would have had to define CITY before hand, and add an element in the $image array for the city itself. Absolute Legend, easy to understand. Thanks so much, this is a great step forward. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.