troubleshooting Question

updating database record after clicking on link

Avatar of Crazy Horse
Crazy HorseFlag for South Africa asked on
PHP
14 Comments2 Solutions154 ViewsLast Modified:
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?
ASKER CERTIFIED SOLUTION
Join our community to see this answer!
Unlock 2 Answers and 14 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 2 Answers and 14 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros