I am using an onclick
function to redirect the user if they are not login.
I am calling a php function in achor tag like this
<a href="#" class="fright hrtacnhor" onclick="<?php checkstatus(); ?>">save to my favorite</a>
and the function I am using is
<?php
function checkstatus(){
wp_redirect( get_permalink( 8 ) );exit;
}
?>
But the problem is that when i click it not call the fucntion. I also try to use wp_redirect()
function directly in onclick
but it not working so any one please guide me how it works. Thanks