nashsaint Posted May 19, 2008 Share Posted May 19, 2008 Hi, I created tables using echo command, displaying SQL Query. I created a link to one of the columns. Now, what i want is to check if the user has visited/clicked the link, if not i want the whole tr background to be something like yellow. Help please. Thanks. Link to comment https://forums.phpfreaks.com/topic/106273-colored-tr-background-when-not-visited/ Share on other sites More sharing options...
thebadbad Posted May 19, 2008 Share Posted May 19, 2008 If the link fills up the whole tr element (CSS of link set to 100% width and height, basically) You could simply use the CSS pseudo-classes ":link" and ":visited". <style type="text/css"> /* Background color of unvisited link with id="urgent" */ a#urgent:link { background-color: yellow; } /* Background color of visited link with id="urgent" */ a#urgent:visited { background-color: transparent; } </style> <a id="urgent" href="link_here">Please check this link!</a> Link to comment https://forums.phpfreaks.com/topic/106273-colored-tr-background-when-not-visited/#findComment-544661 Share on other sites More sharing options...
thebadbad Posted May 19, 2008 Share Posted May 19, 2008 Or, the PHP solution could be done by setting either a cookie or a database entry containing the user IP, on the page you want the user to be sure have visited, and then check for this on the page with the table, and color the background either blank or yellow. Link to comment https://forums.phpfreaks.com/topic/106273-colored-tr-background-when-not-visited/#findComment-544662 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.