473,327 Members | 2,118 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

count by click problem

25
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:

Expand|Select|Wrap|Line Numbers
  1. <form action="test.php" method="get">
  2. <input name="threadid" type="hidden" value="$thread[threadid]" />
  3. <input name="url_link" type="hidden" value="$thread[field17]" />
  4. <input name="blog_views" type="hidden" value="$thread[blog_views]" />
  5.  <a href="test.php?id=$thread[threadid]">$thread[threadtitle]</a> 
  6. </form>
test.php:

Expand|Select|Wrap|Line Numbers
  1. include("db.inc");
  2.     $url_link = $_POST['url_link'];
  3.     $threadid = $_POST['threadid'];
  4.     $blog_views = $_POST['blog_views'];
  5.  
  6.  
  7. $query = "UPDATE thread SET blog_views = blog_views + 1 WHERE threadid  = '$threadid' ";
  8.  
  9. if (!mysql_query($query))
  10. {
  11. echo "<script language=javascript>alert('Data failed to be update');</script>";
  12. }
  13. else {
  14. echo "<script language=javascript>alert('Data has been update successfully');</script>";
  15. }
  16. echo"<script>window.navigate('$url_link')</script>";
May 3 '10 #1
1 1455
The form method is 'get' and you take values from $_POST.;)
May 3 '10 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Jenny | last post by:
Hi all, Hope someone can help me with this ... This is my query. The problem with it is that it only returns Areas with >0 Topics. So if a new Area is created, it hasn't a topic until one is...
1
by: MrNobody | last post by:
I have a DataGrid which I added a MouseUp event: datagrid.MouseUp += new MouseEventHandler(onMouseUp); which simply does: if (e.Button == MouseButtons.Right) { if(hti.Type ==...
0
by: Ben | last post by:
I have a DataGrid in where I have code in the MouseUp Event that checks the area of the Grid clicked, and highlights the entire row. Problem is, that if you the "Right-Click" on another row, it...
3
by: ret4rt | last post by:
Hello. I have a database with movies similar with imdb and i want to find out which directors have directed both thriller and drama movies. The output i want is like this "DIR_NAME,amount of...
16
by: spud379 | last post by:
I am trying to count the amount of times that a button is clicked and when it is clicked 10 times I want to bring a message box. I have tried doing this with an if statement and a loop. with the...
1
by: preeti13 | last post by:
i have a store procedure i am trying to count the records but getting the probelm with this please if any one know about this help me my store procedure is like this CREATE proc...
1
by: reazrana | last post by:
hello i hv a problem. document.getElementById('s_' + route_id ).click(); this works in IE fine but not in FF. i want this works when page is loaded. no mouse click is needed for that....
0
by: Tim | last post by:
Hi all, I'm using AJAX.NET and I've coded a page that changes the text of a button when a checkbox is clicked. The text changes from "Save" to "Keep Processing". The text change seems to...
6
Lensmeister
by: Lensmeister | last post by:
I am getting a little better on this Access DB (in Access 2003) I am making although I am having one problem at this time I cannot fathom out. I have a form (frm_Stats) This form has the following...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.