I am trying to edit the following php code to put it in the login form so when the user login he'll be redirected to his profile page.. here is the code that i am using to go to the profile page using a button ..
<li> <a style="background-color:rgb(40, 198, 218);" <?php echo '<a class="btn" href="'.site_url('show/agentproperties/'.$user_id).'">My Store</a>'; ?>
and i want to edit the form link to put the code above here
<form action="<?php echo site_url('account/login');?>" method="post">
so how do we edit the form to include the 1st code instead of the code that's being used in the form right now.. which just redirects the user to the home page ?
Regards.
-
header('location:profile.php'); is the easy way to redirect a user to his profile page if login doesnt failAmit Verma– Amit Verma2015年03月11日 05:54:34 +00:00Commented Mar 11, 2015 at 5:54
1 Answer 1
have the page submit to itself (optional)
<form action="" method="post">
somewhere in the php located in the page, add something like
if($loggedIn){
header('Location: '.site_url('account/login'));
exit;
}
Sign up to request clarification or add additional context in comments.
1 Comment
TeeToo
i want to use {.site_url('show/agentproperties/'.$user_id).} for the site url
lang-php