Answer the question
In order to leave comments, you need to log in
How to make PHP code activated when clicked?
In general, I want to make it so that when clicking on an element, the user is redirected to another page if he is not registered on the site. How can this be done with Javascript and PHP? In PHP I'm going to use the header('location: sign_in.php') function.
Answer the question
In order to leave comments, you need to log in
nemisqe , As already written, do it in pure js.
let cookies = document.cookie;
if(cookies==0){
document.location.href = 'http://yandex.ru';
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question