rabijit Posted November 18, 2016 Share Posted November 18, 2016 Hello, I want to redirect logged user to clientarea.php like {if $loggedin} redirect to clientarea.php {else} somecode {/if} Thanks in advance. 0 Quote Link to comment Share on other sites More sharing options...
sentq Posted November 18, 2016 Share Posted November 18, 2016 create new file in /includes/hooks/ directory, eg. clientloginredirect.php put the following code inside it: <?php add_hook("ClientLogin", 1, function(){ header("Location: clientarea.php"); exit; }); this will redirect clients to "clientarea.php" page once they logged in 0 Quote Link to comment Share on other sites More sharing options...
rabijit Posted November 19, 2016 Author Share Posted November 19, 2016 Sorry for late reply, actually I customized homepage.tpl, added a login and registration form. So want to redirect to clientarea.php, when a logged in user try to visit index.php or homepage 0 Quote Link to comment Share on other sites More sharing options...
sentq Posted November 20, 2016 Share Posted November 20, 2016 then use the following hook instead, <?php add_hook("ClientAreaPage", 1, function($vars){ if ($_SESSION['uid'] && $vars['filename']=="index"){ header("Location: clientarea.php"); exit; } }); 0 Quote Link to comment Share on other sites More sharing options...
Waqas Saeed Posted November 8, 2020 Share Posted November 8, 2020 (edited) If we redirect using javascript window.location.replace ? Will it possibly not logout the client if customer is already signin? Edited November 8, 2020 by Waqas Saeed 0 Quote Link to comment Share on other sites More sharing options...
CassidyDNS Posted November 8, 2020 Share Posted November 8, 2020 The below should work, but you should avoid using javascript as it wont work if it's been disabled in the users browser. window.location.replace("logout.php"); 0 Quote Link to comment Share on other sites More sharing options...
yarantoos Posted July 4, 2022 Share Posted July 4, 2022 Hello, Could you please send your customized homepage.tpl ? 0 Quote Link to comment Share on other sites More sharing options...
yarantoos Posted July 4, 2022 Share Posted July 4, 2022 On 11/20/2016 at 3:23 AM, rabijit said: Sorry for late reply, actually I customized homepage.tpl, added a login and registration form. So want to redirect to clientarea.php, when a logged in user try to visit index.php or homepage Hello, Could you please send your customized homepage.tpl ? 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.