|
| Index | Recent Threads | Unanswered Threads | Who's Online | User List | Help |
|
|
| No member browsing this thread |
|
Thread Status: Active Total posts in this thread: 1
|
|
| Author |
|
|
Stranger Joined: Aug 27, 2006 Post Count: 13 Status: Offline |
hi viewer, i am soo new to this programming and have a problem i am trying to solve. my coding is not very good which is why i am here seeking advice. what i am trying to acheive is this. 1. assign co-ordinates to x & y 2. display a small red spot on the image using assigned co-ods. this is the part im having trouble with... 3. loop through and place more red spots with the new co-ods so that i have multiple red spots on the image at the new co-od positions. anyway here is the code, i have narrowed it down to what i think is necessary. <? $c = $_GET['$c']; ?> <html> <head> <title>game screen</title> <script language="JavaScript"> $catchcounter = 1; $counter = 0; $fishpicpath = 'singlecatch/uploads/'; firstname = new Array(); lastname = new Array(); fishpic = new Array(); xpoint = new Array(); ypoint = new Array(); <?php $y = 0; $conn = mysql_connect("blahblah","blahblah","blahblah"); //select database mysql_select_db("blahblah",$conn); //get venue data $sql = "SELECT * FROM `singlecatchupload` WHERE `venue`= '$_POST[venue_name]'"; $sql2 = "SELECT * FROM `venue` WHERE `venuename`= '$_POST[venue_name]'"; //execute the sql statement $result = mysql_query($sql, $conn) or die(mysql_error()); $result2 = mysql_query($sql2, $conn) or die(mysql_error()); //go through each row and assign data while ($newArray = mysql_fetch_array($result2)) { $venuepic = $newArray['venuepic']; } while ($newArray = mysql_fetch_array($result)) { $coodx[$y] = $newArray['coodx']; $coody[$y] = $newArray['coody']; print "xpoint.push(\"$coodx[$y]\" );"; print "ypoint.push(\"$coody[$y]\" );"; $y = $y + 1; } ?> window.onload=showcatchlocs function showcatchlocs() { document.getElementById("lilred").style.visibility = "visible" ; document.getElementById("lilred").style.left = (xpoint[$counter]-1) ; document.getElementById("lilred").style.top = (ypoint[$counter]-2) ; } </script> </head> <? echo "<div id='venue_pic' img name='venue_pic' id='venue_pic' style = 'background-image:url(uploads/$venuepic);width:1000px;height:700px;'</div>"; ?> <style> #lilred {position: absolute; top:<?=$coody[2]?>; left:<?=$coodx[2]?>} </style> <img src="images/lilred.gif" alt="image" id="lilred" style='position:relative;visibility:hidden;'> </body> </html> |
||
|
|
|
|
|
Current timezone is GMT May 25, 2013 2:35:35 PM |