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. Link to comment https://forums.phpfreaks.com/topic/115519-how-to-disable-a-hyper-link/ 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. Link to comment https://forums.phpfreaks.com/topic/115519-how-to-disable-a-hyper-link/#findComment-593849 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. Link to comment https://forums.phpfreaks.com/topic/115519-how-to-disable-a-hyper-link/#findComment-593852 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... Link to comment https://forums.phpfreaks.com/topic/115519-how-to-disable-a-hyper-link/#findComment-593856 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. Link to comment https://forums.phpfreaks.com/topic/115519-how-to-disable-a-hyper-link/#findComment-593860 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. Link to comment https://forums.phpfreaks.com/topic/115519-how-to-disable-a-hyper-link/#findComment-593883 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.