I have this code it works the user logs in successfully but I also need to make it so that once logged in he gets redirected to another page I am not very familiar with php and I have looked around here and with google and to make redirect when submit I saw that you change the action="destination url" but it already has that php code in it and if I change that it does not work. I appreciate any and all help with this.
<div id="apDiv4">
<form name="login-form" id="sidebar-login-form" class="standard-form" action=" <?php echo site_url( 'wp-login.php', 'login_post' ) ?>" method="post">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><table width="100%" border="0" cellspacing="0" cellpadding="5">
<tr>
<td>
<label><?php _e( 'Username', 'buddypress' ) ?>
<input type="text" name="log" id="sidebar-user-login" class="input" value="<?php echo esc_attr(stripslashes($user_login)); ?>" /></label>
</td>
<td>
<label><?php _e( 'Password', 'buddypress' ) ?>
<input type="password" name="pwd" id="sidebar-user-pass" class="input" value="" /></label>
</td>
</tr>
<tr><td>
<p class="forgetmenot"><label><input name="rememberme" type="checkbox" id="sidebar-rememberme" value="forever" /> <?php _e( 'Remember Me', 'buddypress' ) ?></label></p></td>
<td>
<?php do_action( 'bp_sidebar_login_form' ) ?>
<input type="image" value=<img src="http://anime.edgardoroldanonline.com/wp-content/themes/buddyboss-child-fixed-navbar/images/button-letmein.png" width="127" height="26" name="wp-submit" id="sidebar-wp-submit" tabindex="100" />
<input type="hidden" name="testcookie" value="1" />
?>
</td>
</td>
</tr>
</table></td>
</tr>
</table>
</form>
</div>
As its wordpress your working with you should use a hidden field in your form (redirect_to). Its a feature.
on line 570 of wp-login.php it will handle the redirect value after login:
Side note: You can also directly invoke the redirect function with wp_redirect():
You're going to want to use a
header("Location: /some/page.php")
call in your PHP script that processes the form values.This redirection has to be done server-side because your server first needs to actually receive the data, so you can't change the action field.
On the php file where you're processing the transaction you could use header-location: