Disable a link once its clicked
Posted on 2010-08-30
I am trying to create a link in a php file known as attempt.php which displays a question with four options and user selects one and submits it. Each time the user submits his option, he gets a new question by refreshing the page. So he stays on the same page and keeps answering the questions. Now I want to create a hint answer kind of thing.
I want to create a link clicking on which a new php file namely studenthelp.php opens up which would show him the count of people choosing each option for that question which could act like a hint and the user knows what is the right answer. But once the user clicks and uses this link, even if the page (attempt.php) refreshes after that, he shouldn't be able to see or access the link.
I have tried using onclick() but that only disables the link till the page is not refreshed. As soon as the user refreshes the page to get another question, the link shows up again, which is something I don't want. I have tried using pseudo style sheet attributes (visibility, display) but they don't seem to be working.
Any help or suggestions on this would be appreciated.