webpage: conditional transfer to another page

I would like to show a button on a webpage ONLY if some particular page as already been visited. Is there a way to do this kind of "conditional" linking with HTML, CSS, or JavaScript?

For example, I have pages A and B. I would like to show a button on page A then when clicked takes me to page B, but ONLY if page B has already been visited. If page B has NOT been visited, I don't want to show the button on page A.

Thanks for any help.

Mark
karnac2020Asked:
Who is Participating?
 
skullnobrainsConnect With a Mentor Commented:
#yourlink{
display:none;
}

#yourlink:visited{
display:inline;
}

the above requires that the exact same url was visited and is easy to bypass if the users want to

you can devise similar solutions is js/jquery

if you need something more robust, you'll have to do it server side : identify which clients visited siteB and store the info in a database. read the db when generating page A and include the button if needed.
0
 
pierrejeanesCommented:
But how the are going to visit page b if the button only appears if they have visited page b? Unless they get to page b by direct link?
0
 
pierrejeanesCommented:
Perhaps using cookies or user accounts ( wich require some database)
0
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
karnac2020Author Commented:
They get to page B via another link or path. The current website is built with ASP.NET so it uses a MSSQL database.
0
 
karnac2020Author Commented:
nice solution
0
 
skullnobrainsCommented:
thanks. beware this is trivial to bypass for many users
0
All Courses

From novice to tech pro — start learning today.