hello
i need to count number of click for the link.
but when i run my code, there's no function. the problem still the same. the count per click does not increase.
here my code:
html:
test.php:
i need to count number of click for the link.
but when i run my code, there's no function. the problem still the same. the count per click does not increase.
here my code:
html:
Code:
<form action="test.php" method="get"> <input name="threadid" type="hidden" value="$thread[threadid]" /> <input name="url_link" type="hidden" value="$thread[field17]" /> <input name="blog_views" type="hidden" value="$thread[blog_views]" /> <a href="test.php?id=$thread[threadid]">$thread[threadtitle]</a> </form>
Code:
include("db.inc");
$url_link = $_POST['url_link'];
$threadid = $_POST['threadid'];
$blog_views = $_POST['blog_views'];
$query = "UPDATE thread SET blog_views = blog_views + 1 WHERE threadid = '$threadid' ";
if (!mysql_query($query))
{
echo "<script language=javascript>alert('Data failed to be update');</script>";
}
else {
echo "<script language=javascript>alert('Data has been update successfully');</script>";
}
echo"<script>window.navigate('$url_link')</script>";
Comment