redirect - PHP continue statement? -


im trying create redirect if user not logged in , havin trouble

here method im using

<?php if ( is_user_logged_in() ) { ?>  /*my content*/  <?php     } else {         echo '<meta http-equiv="refresh" content="0; url=http://www.*****.com/non-member.php">';     } ?> 

this working fine delayed , im able see page few seconds before redirects.

what this.

<?php if ( is_user_logged_in() ) {      /*ignore next statement*/ } else {         echo '<meta http-equiv="refresh" content="0; url=http://www.****.com/non-member.php">';     } ?> 

im not sure if possable assume there mehod out there somehow.

for type of behavior, you're better off using header:

<?php // place @ top, before (including whitespace). if( !is_user_logged_in() ) {     header("location: http://www.****.com/non-member.php");     die(); // don't want rest of page showing. } ?> 

that you're trying without letting person isn't logged in see page first.


Comments

Popular posts from this blog

linux - Using a Cron Job to check if my mod_wsgi / apache server is running and restart -

actionscript 3 - TweenLite does not work with object -

jQuery Ajax Render Fragments OR Whole Page -