coder9 Posted July 18, 2008 Share Posted July 18, 2008 I wonder if this is possible. Let say i have a link or hyper link. after i click that link (left click) the link will disable and turn it's color into gray. is this possible in php? if no possible in php maybe javascript or css? any sample? or tutorial? Thank you a ton. Quote Link to comment Share on other sites More sharing options...
ratcateme Posted July 18, 2008 Share Posted July 18, 2008 you clould log the links that the user has been to with $_SESSION then put a check before each url is outputted to check if it has already been clicked on. Scott. Quote Link to comment Share on other sites More sharing options...
DeanWhitehouse Posted July 18, 2008 Share Posted July 18, 2008 erm, you could remove the href from it, after they click it , but the page would need to be reloaded. Quote Link to comment Share on other sites More sharing options...
coder9 Posted July 18, 2008 Author Share Posted July 18, 2008 you clould log the links that the user has been to with $_SESSION then put a check before each url is outputted to check if it has already been clicked on. Scott. hi Scott, thanks for the reply any basic sample please... Quote Link to comment Share on other sites More sharing options...
ratcateme Posted July 18, 2008 Share Posted July 18, 2008 every page has this on top <?php sesion_start(); $_SESSION['pages'][{$_SERVER['REQUEST_URI']}]=true; ?> and a function for printing links <?php function print_link($href,$text){ if(array_key_exists($_SERVER['REQUEST_URI'],$_SESSION['pages'])){ echo "<a href=\"{$href}\">{$text}</a>"; }else{ echo "<span style=\"color:#CCCCCCC;\">{$text}</span>"; } ?> Scott. Quote Link to comment Share on other sites More sharing options...
coder9 Posted July 18, 2008 Author Share Posted July 18, 2008 every page has this on top <?php sesion_start(); $_SESSION['pages'][{$_SERVER['REQUEST_URI']}]=true; ?> and a function for printing links <?php function print_link($href,$text){ if(array_key_exists($_SERVER['REQUEST_URI'],$_SESSION['pages'])){ echo "<a href=\"{$href}\">{$text}</a>"; }else{ echo "<span style=\"color:#CCCCCCC;\">{$text}</span>"; } ?> Scott. Thanks man i'll try that. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.