PDA

View Full Version : Disable Links After Click, Display Something Else



SChaput
06-30-2009, 10:45 PM
I want to disable a certain link after the user clicks it. Once the page is reloaded i want the link to disappear and display some other text in its place.

What is the best way to do it?

EDIT:
I've managed to add the IP address of the user, and a timestamp using NOW() into my mysql database...Now...i cant figure out how to find the difference between the NOW in the database and the NOW generated on the next page load.
Advice is greatly appreciated, thanks!

xtiano77
07-02-2009, 01:38 AM
I think that JavaScript will work better when it comes to disabling HTML tags; however, I think it would be better if you post your code so we can look at it and point you in the right direction.

Elkidogz
07-02-2009, 10:49 PM
yeah, i mean what your asking for seems to be a form submission, and if it's just a random thing, you can use the random class which will generate random characters to reappear.

I actually did this for a website client who wanted to have a different page background appear each time his site vistors clicked on a link. he had something like 230 pictures he had amassed and wanted the background to randomly pick one. When the user clicked on a link / form / whatever and it loaded a new page, the background would change... I added some ajax magic fade and it looked really good then.

if your just wanting to have the browser click then have the text changed, you can use php's random class to give the appearance of a random selection within an array of choices. in my case it pulled all the pictures out of a folder, put these file names into an array and then randomly picked one.