0

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.

asked Mar 11, 2015 at 5:45
1
  • header('location:profile.php'); is the easy way to redirect a user to his profile page if login doesnt fail Commented Mar 11, 2015 at 5:54

1 Answer 1

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;
}
answered Mar 11, 2015 at 5:56
Sign up to request clarification or add additional context in comments.

1 Comment

i want to use {.site_url('show/agentproperties/'.$user_id).} for the site url

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.