It seems that doing this does not have an effect:
a:visited{
color: #red;
}
Is there another possibility of knowing which page the person has already visited?
I'm using php
It seems that doing this does not have an effect:
a:visited{
color: #red;
}
Is there another possibility of knowing which page the person has already visited?
I'm using php
Using cookies you can check if a page has been visited.
For example:
setcookie("visitado", "1" /*, time() + 3600 */);
Where the third parameter that was omitted sets the cookie to expire in one hour, when omitted the cookie is only valid until the browser is closed.
Remember that the cookie must be created before any output, so it is best to create it at the beginning of the code.
In your layout file you would do something like:
<a class="<?= key_exists("visitado", $_COOKIE) ? 'visited' : '' ?>">Página inicial</a>
And in your css file:
.visitado {
color: red;
}