We help IT Professionals succeed at work.
Get Started

updating database record after clicking on link

Black Sulfur
Black Sulfur asked
Last Modified: 2016-10-09
I had this question after viewing Should I use post or get to go to a specific record in a list of records.

When a user clicks on this link I want the status of the post to change from "unread" to "read". using the GET method I think I would have to perform the update on the page that the href actually links to i.e.:

contact_detail.php?contact_id=<?php echo $contact_id; ?>">

so, my SQL query would run on the contact_detail.php page. I don't really like this even though it would work. It is unlikely that the administrator of the site is going to fiddle with the values in the URL to set random messages to read but I want to try prevent it anyway. So, would the way be then to perform the update when the user actually clicked the link?
Watch Question
Most Valuable Expert 2011
Author of the Year 2014
This problem has been solved!
Unlock 2 Answers and 14 Comments.
See Answers
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE