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>

Link to comment
Share on other sites

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
Share on other sites

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
Share on other sites

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
Share on other sites

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
Share on other sites

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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.