hey i got a slightly weird problem..
i got a form enabling login in certain single's according to the cateory and user level.. it works great but the server which is windows (where the website is hosted on returns the wrong "current page" value
Meaning.. this:
'redirect' => site_url( $_SERVER['REQUEST_URI'] ),
returns this: www.somewebsite.com/sub/sub/?p=100
instead of: www.somewebsite.com/sub/?p=100
This is the actuall form:
<div class="logincategory"> <?php wp_login_form( $args ); $args = array( 'echo' => true, 'redirect' => site_url($_SERVER['REQUEST_URI']), 'form_id' => 'loginform', 'label_username' => __( 'Username' ), 'label_password' => __( 'Password' ), 'label_remember' => __( 'Remember Me' ), 'label_log_in' => __( 'Log In' ), 'id_username' => 'user_login', 'id_password' => 'user_pass', 'id_remember' => 'rememberme', 'id_submit' => 'wp-submit', 'remember' => true, 'value_username' => NULL, 'value_remember' => false ); ?> </div>
So.. this is a bug of the server which i can't solve directly
so i used
$myCurrentUrl = site_url( $_SERVER['REQUEST_URI'] ); $myCurrentUrltwo = str_replace("www.somewebsite.com/sub/sub/","www.somewebsite.com/sub/", "$myCurrentUrl");
That (when eching) returns the right URL but how do i insert the variable into this command
'redirect' => site_url( $_SERVER['REQUEST_URI'] ),