Jump to content

[SOLVED] Map hotspot


patrickking04

Recommended Posts

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>

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

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

 

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 

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 
}
?>

 

 

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 
}
?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.