javascript - Direct html page access denied -
can 1 tell me how can prevent html page access directly through url want acccess login members page contain image(this page developed on word press) refers html page , page needs access login member only. can 1 suggest javascript code have used following script:
if (document.referrer.indexof('flipbook_signup/wp-admin/profile/') == -1) { alert("please login!"); top.location="http://google.com"; }
but alerting message in both conditions. other solution?
it difficult javascript, there need know or user logged in ... add php code (could different wp) in html page:
<?php if ( $user_id ) : // if logged in ?> .... here html code <?php else : // if not logged in go login page $url = 'register'; header("location:$url"); endif; // end if logged in ?>
and in .htaccess (allow php code in html):
<files *.html> forcetype application/x-httpd-php </files>
Comments
Post a Comment