phpdragon Posted March 6, 2009 Share Posted March 6, 2009 you need to make sure that the id number there in each zone is the same as the ones in your database for each zone Link to comment https://forums.phpfreaks.com/topic/148068-solved-map-hotspot/page/2/#findComment-778042 Share on other sites More sharing options...
patrickking04 Posted March 6, 2009 Author Share Posted March 6, 2009 Yeah i checked it and the id corrsponds to the same id in the database. Link to comment https://forums.phpfreaks.com/topic/148068-solved-map-hotspot/page/2/#findComment-778095 Share on other sites More sharing options...
patrickking04 Posted March 6, 2009 Author Share Posted March 6, 2009 heres what i have no the main page. <?php include 'connect.php'; ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <meta name="Generator" content="Serif WebPlus 11.0.6.030"> <title>Home</title> </head> <a href="processbully.php?id=1"><img src="wpimages/Math_corri.png" width="14" height="152" border="0" id="Math_corri" name="Math_corri" title="" alt="" onload="OnLoadPngFix()"></a></div> </div> </body> </html> Link to comment https://forums.phpfreaks.com/topic/148068-solved-map-hotspot/page/2/#findComment-778180 Share on other sites More sharing options...
phpdragon Posted March 6, 2009 Share Posted March 6, 2009 is it sending the id now and echoing it? show me your current code for the page that you are using to pass to the processbully.php. also test this make a new blank page with this on it <a href="processbully.php?id=1">click</a> change the id to one that matches one in your database Link to comment https://forums.phpfreaks.com/topic/148068-solved-map-hotspot/page/2/#findComment-778181 Share on other sites More sharing options...
phpdragon Posted March 6, 2009 Share Posted March 6, 2009 this line needs to be in your processbully.php page above the if isset statement include 'connect.php'; Link to comment https://forums.phpfreaks.com/topic/148068-solved-map-hotspot/page/2/#findComment-778187 Share on other sites More sharing options...
patrickking04 Posted March 6, 2009 Author Share Posted March 6, 2009 included it and i get ID is ().Error: not updated even on the test page with just the hyperlink Link to comment https://forums.phpfreaks.com/topic/148068-solved-map-hotspot/page/2/#findComment-778193 Share on other sites More sharing options...
phpdragon Posted March 6, 2009 Share Posted March 6, 2009 does it send the id variable across? put this on another blank page and change the link to the new page for testing <?php echo $id; ?> Link to comment https://forums.phpfreaks.com/topic/148068-solved-map-hotspot/page/2/#findComment-778194 Share on other sites More sharing options...
patrickking04 Posted March 6, 2009 Author Share Posted March 6, 2009 nope does'nt print the anything. Link to comment https://forums.phpfreaks.com/topic/148068-solved-map-hotspot/page/2/#findComment-778201 Share on other sites More sharing options...
phpdragon Posted March 6, 2009 Share Posted March 6, 2009 Totally for testing make one page called send.php and put only the following in it <a href="get.php?id=1">click</a> make another page called get.php and put only the following in it <?php echo "ID is ".$id; ?> then open send.php in your browser and click on the click link, you should then get a page that says ID is 1 Link to comment https://forums.phpfreaks.com/topic/148068-solved-map-hotspot/page/2/#findComment-778203 Share on other sites More sharing options...
patrickking04 Posted March 6, 2009 Author Share Posted March 6, 2009 Totally for testing make one page called send.php and put only the following in it <a href="get.php?id=1">click</a> make another page called get.php and put only the following in it <?php echo "ID is ".$id; ?> then open send.php in your browser and click on the click link, you should then get a page that says ID is 1 just prints ID is Link to comment https://forums.phpfreaks.com/topic/148068-solved-map-hotspot/page/2/#findComment-778215 Share on other sites More sharing options...
phpdragon Posted March 6, 2009 Share Posted March 6, 2009 there is an issue in your php configuration then, if your setup wont pass a variable between pages, what type of server setup are you using? Link to comment https://forums.phpfreaks.com/topic/148068-solved-map-hotspot/page/2/#findComment-778219 Share on other sites More sharing options...
patrickking04 Posted March 6, 2009 Author Share Posted March 6, 2009 hmmm... thats what i was just thinking. its a ubuntu lamp setup. might just install wamp on a virtual xp pc and see if it works. Link to comment https://forums.phpfreaks.com/topic/148068-solved-map-hotspot/page/2/#findComment-778224 Share on other sites More sharing options...
phpdragon Posted March 6, 2009 Share Posted March 6, 2009 looks like globals is not enabled in php. On your get.php test page put this inside the php tags but before the echo statement $id=$_GET["id"]; Link to comment https://forums.phpfreaks.com/topic/148068-solved-map-hotspot/page/2/#findComment-778228 Share on other sites More sharing options...
patrickking04 Posted March 6, 2009 Author Share Posted March 6, 2009 <?php $id=$_GET["id"]; echo "ID is ".$id; ?> produces this ID is 1 Link to comment https://forums.phpfreaks.com/topic/148068-solved-map-hotspot/page/2/#findComment-778231 Share on other sites More sharing options...
phpdragon Posted March 6, 2009 Share Posted March 6, 2009 your on fire now add that line to your processbully.php page and all will work Link to comment https://forums.phpfreaks.com/topic/148068-solved-map-hotspot/page/2/#findComment-778232 Share on other sites More sharing options...
patrickking04 Posted March 6, 2009 Author Share Posted March 6, 2009 i now get ID is (1).Error: not updated Link to comment https://forums.phpfreaks.com/topic/148068-solved-map-hotspot/page/2/#findComment-778235 Share on other sites More sharing options...
phpdragon Posted March 6, 2009 Share Posted March 6, 2009 lol at least we are getting the variable now please post your current processbully.php page Link to comment https://forums.phpfreaks.com/topic/148068-solved-map-hotspot/page/2/#findComment-778236 Share on other sites More sharing options...
patrickking04 Posted March 6, 2009 Author Share Posted March 6, 2009 This is whats on the server right now. <?php include 'connect.php'; ?> <?php $id=$_GET["ID"]; echo "ID is ($ID)."; if (isset($id)) { $sql="SELECT * FROM hotspot WHERE ID=$ID"; //Select every thing from 'hotspot' table $query=mysql_query($sql); $row=mysql_fetch_array($query); $name=$row['zone'];// Zone area $value=$row['bullcount'];// counts of bullys $newvalue=$value+1; $sql="UPDATE hotspot SET bullcount='$newvalue' WHERE ID=$ID"; //updates counts of bullys by +1 $query=mysql_query($sql); echo "$newvalue incidents in area $name"; //Prints new total count and area name. } else { die("Error:$id not updated"); //Prints error } ?> Link to comment https://forums.phpfreaks.com/topic/148068-solved-map-hotspot/page/2/#findComment-778242 Share on other sites More sharing options...
phpdragon Posted March 6, 2009 Share Posted March 6, 2009 try this <?php include 'connect.php'; $id=$_GET["id"]; if (!empty($id)) { $sql="SELECT * FROM hotspot WHERE id='$id'"; //Select every thing from 'hotspot' table $query=mysql_query($sql); $row=mysql_fetch_array($query); $name=$row['zone'];// Zone area $value=$row['bullcount'];// counts of bullys $newvalue=$value+1; $sql="UPDATE hotspot SET bullcount='$newvalue' WHERE id='$id'"; //updates counts of bullys by +1 $query=mysql_query($sql); echo "$newvalue incidents in area $name"; //Prints new total count and area name. } else { die("Error:$id not updated"); //Prints error } ?> Link to comment https://forums.phpfreaks.com/topic/148068-solved-map-hotspot/page/2/#findComment-778251 Share on other sites More sharing options...
patrickking04 Posted March 6, 2009 Author Share Posted March 6, 2009 I got this now 1 incidents in area but nothing was added to mysql Link to comment https://forums.phpfreaks.com/topic/148068-solved-map-hotspot/page/2/#findComment-778262 Share on other sites More sharing options...
patrickking04 Posted March 6, 2009 Author Share Posted March 6, 2009 you done it mate. it works now. and adds to the database; Link to comment https://forums.phpfreaks.com/topic/148068-solved-map-hotspot/page/2/#findComment-778266 Share on other sites More sharing options...
phpdragon Posted March 6, 2009 Share Posted March 6, 2009 Wonderful, you should be able to modify it to suit the rest of your needs now , be sure to mark the topic solved. Link to comment https://forums.phpfreaks.com/topic/148068-solved-map-hotspot/page/2/#findComment-778277 Share on other sites More sharing options...
patrickking04 Posted March 6, 2009 Author Share Posted March 6, 2009 i sure will, thanks again for all the help. Link to comment https://forums.phpfreaks.com/topic/148068-solved-map-hotspot/page/2/#findComment-778295 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.