<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Redirect dopo registrazione]]></title><description><![CDATA[<p dir="auto">Ciao a tutti,<br />
vorrei fare un reindirizzare l'utente a una pagina precisa dopo aver effettuato la registrazione al mio blog.<br />
Ho trovato il codice ma non so da dove iniziare;D Potreste aiutarmi, grazie.</p>
<p dir="auto">Grazie mille per l'aiuto;D</p>
<p dir="auto">[PHP]&lt;?php<br />
/**</p>
<ul>
<li>
<p dir="auto">Template name: Login Page</p>
</li>
<li></li>
<li></li>
<li>
<p dir="auto">@package WordPress</p>
</li>
<li>
<p dir="auto">@subpackage classiads</p>
</li>
<li>
<p dir="auto">@since classiads 1.2.2<br />
*/</p>
</li>
</ul>
<p dir="auto">if ( is_user_logged_in() ) {</p>
<pre><code>global $redux_demo;
$profile = $redux_demo['profile'];
wp_redirect( $profile ); exit;
</code></pre>
<p dir="auto">}</p>
<p dir="auto">global $user_ID, $username, $password, $remember;</p>
<p dir="auto">//We shall SQL escape all inputs<br />
$username = esc_sql(isset($_REQUEST['username']) ? $_REQUEST['username'] : '');<br />
$password = esc_sql(isset($_REQUEST['password']) ? $_REQUEST['password'] : '');<br />
$remember = esc_sql(isset($_REQUEST['rememberme']) ? $_REQUEST['rememberme'] : '');</p>
<p dir="auto">if($remember) $remember = "true";<br />
else $remember = "false";<br />
$login_data = array();<br />
$login_data['user_login'] = $username;<br />
$login_data['user_password'] = $password;<br />
$login_data['remember'] = $remember;<br />
$user_verify = wp_signon( $login_data, false );<br />
//wp_signon is a wordpress function which authenticates a user. It accepts user info parameters as an array.<br />
if($_POST['submit'] == 'Login'){<br />
if ( is_wp_error($user_verify) ) {<br />
$UserError = _e('Invalid username or password. Please try again!','agrg');<br />
} else {</p>
<pre><code>    global $redux_demo;
    $profile = $redux_demo['profile'];
    wp_redirect( $profile ); exit;

}
</code></pre>
<p dir="auto">}<br />
global $redux_demo;<br />
$login = $redux_demo['login'];<br />
$rand1 = rand(0,9);<br />
$rand2 = rand(0,9);<br />
$rand_answer = $rand1 + $rand2;</p>
<p dir="auto">global $resetSuccess;</p>
<p dir="auto">if (!$user_ID) {</p>
<pre><code>if($_POST['submit'] == 'Reset')

{

    // First, make sure the email address is set
    if ( isset( $_POST['email'] ) &amp;&amp; ! empty( $_POST['email'] ) ) {

          // Next, sanitize the data
          $email_addr = trim( strip_tags( stripslashes( $_POST['email'] ) ) );

          $user = get_user_by( 'email', $email_addr );
          $user_ID = $user-&gt;ID;

          if( !empty($user_ID)) {

            $new_password = wp_generate_password( 12, false );

            if ( isset($new_password) ) {

                wp_set_password( $new_password, $user_ID );

                $message = _e('Check your email for new password.','agrg');

                  $from = get_option('admin_email');
                $headers = 'From: '.$from . "\r\n";
                $subject = "Password reset!";
                $msg = "Reset password.\nYour login details\nNew Password: $new_password";
                wp_mail( $email_addr, $subject, $msg, $headers );

                $resetSuccess = 1;

            }

        } else {

              $message = _e('There is no user available for this email.','agrg');

        } // end if/else

    } else {
        $message = _e('Email should not be empty.','agrg');
    }

}
</code></pre>
<p dir="auto">}</p>
<p dir="auto">get_header(); ?&gt;<br />
&lt;div class="ad-title"&gt;</p>
<pre><code>            &lt;h2&gt;&lt;?php the_title(); ?&gt; &lt;/h2&gt;
&lt;/div&gt;

&lt;section class="ads-main-page"&gt;

    &lt;div class="container"&gt;
        &lt;div id="edit-profile" class="clearfix"&gt;
</code></pre>
<p dir="auto">&lt;?php</p>
<p dir="auto">?&gt;</p>
<pre><code>                &lt;div class="span4 log-forms"&gt;
                    &lt;h3&gt;&lt;?php _e( 'LOGIN', 'agrg' ); ?&gt;&lt;/h3&gt;
                        &lt;form class="form-item login-form" action="" id="primaryPostForm" method="POST" enctype="multipart/form-data"&gt;
                        &lt;?php if($_GET['action'] == 'resetpass'){ ?&gt;
                            &lt;span style="margin-bottom: 10px; float: left;"&gt;&lt;?php _e( 'Go to your inbox or spam/junk and get your password', 'agrg' ); ?&gt;&lt;/span&gt;
                        &lt;?php  } ?&gt;
                        &lt;?php if($_GET['action'] == 'register' &amp;&amp; $_GET['success'] == '1'){ ?&gt;
                            &lt;span style="margin-bottom: 10px; float: left;"&gt;&lt;?php _e( 'Go to your inbox or spam/junk and get your password', 'agrg' ); ?&gt;&lt;/span&gt;
                        &lt;?php  } ?&gt;
                            &lt;?php global $user_ID, $user_identity;
                            $current_user = wp_get_current_user(); ?&gt;

                            &lt;?php if(!empty($UserError)) { ?&gt;
                                &lt;span class='error' style='color: <a class="plugin-hashtag-a" href="https://connect.gt/hashtags/d20000">#d20000</a>; margin-bottom: 20px; font-size: 14px; float: left;'&gt;&lt;?php echo $UserError; ?&gt;&lt;/span&gt;&lt;div class='clearfix'&gt;&lt;/div&gt;
                            &lt;?php } ?&gt;

                                    &lt;input type="text" id="contactName" Placeholder="&lt;?php _e( 'UserName', 'agrg' ); ?&gt;" name="username" class="text input-textarea half" value="" /&gt;


                                    &lt;input type="password" id="password" Placeholder="&lt;?php _e( 'Password', 'agrg' ); ?&gt;" name="password" class="text input-textarea half" value="" /&gt;



                                &lt;fieldset class="input-title"&gt;

                                    &lt;label for="edit-title" class="remember-me"&gt;
                                        &lt;input name="rememberme" type="checkbox" value="forever" style="float: left;"/&gt;&lt;span style="margin-left: 10px; float: left;"&gt;&lt;?php _e( 'Remember me', 'agrg' ); ?&gt;&lt;/span&gt;

                                        &lt;?php

                                            global $redux_demo;
                                            $reset = $redux_demo['reset'];

                                        ?&gt;

                                    &lt;/label&gt;

                                &lt;/fieldset&gt;



                                    &lt;input type="hidden" id="submitbtn" name="submit" value="Login" /&gt;
                                    &lt;div class="clearfix"&gt;&lt;/div&gt;

                                        &lt;button class="btn form-submit" id="edit-submit" name="op" value="&lt;?php _e( 'Publish Ad', 'agrg' ); ?&gt;" type="submit"&gt;&lt;?php _e('LOGIN NOW', 'agrg') ?&gt;&lt;/button&gt;




                        &lt;/form&gt;
                        &lt;div class="clearfix"&gt;&lt;/div&gt;

                    &lt;span class="sign-free"&gt;&lt;?php _e('Sign Up for Free', 'agrg') ?&gt;&lt;/span&gt;
                    &lt;div class="register-page-title"&gt;

                        &lt;h5&gt;&lt;?php _e( 'Login via Social Media', 'agrg' ); ?&gt;&lt;/h5&gt;

                    &lt;/div&gt;
                    &lt;div class="social-btn clearfix"&gt;
                        &lt;?php
                        /**
                         * Detect plugin. For use on Front End only.
                         */
                        include_once( ABSPATH . 'wp-admin/includes/plugin.php' );

                        // check for plugin using plugin name
                        if ( is_plugin_active( "nextend-facebook-connect/nextend-facebook-connect.php" ) ) {
                          //plugin is activated

                        ?&gt;

                                &lt;a class="register-social-button-facebook" href="&lt;?php echo get_site_url(); ?&gt;/wp-login.php?loginFacebook=1" onclick="window.location = '&lt;?php echo get_site_url(); ?&gt;/wp-login.php?loginFacebook=1&amp;redirect='+window.location.href; return false;"&gt;&lt;?php _e('Login via Facebook', 'agrg') ?&gt;&lt;/a&gt;

                        &lt;?php } ?&gt;

                        &lt;?php
                        /**
                         * Detect plugin. For use on Front End only.
                         */
                        include_once( ABSPATH . 'wp-admin/includes/plugin.php' );

                        // check for plugin using plugin name
                        if ( is_plugin_active( "nextend-twitter-connect/nextend-twitter-connect.php" ) ) {
                          //plugin is activated

                        ?&gt;

                                &lt;a class="register-social-button-twitter" href="&lt;?php echo get_site_url(); ?&gt;/wp-login.php?loginTwitter=1" onclick="window.location = '&lt;?php echo get_site_url(); ?&gt;/wp-login.php?loginTwitter=1&amp;redirect='+window.location.href; return false;"&gt;&lt;?php _e('Login via Twitter', 'agrg') ?&gt;&lt;/a&gt;


                        &lt;?php } ?&gt;

                        &lt;?php
                        /**
                         * Detect plugin. For use on Front End only.
                         */
                        include_once( ABSPATH . 'wp-admin/includes/plugin.php' );

                        // check for plugin using plugin name
                        if ( is_plugin_active( "nextend-google-connect/nextend-google-connect.php" ) ) {
                          //plugin is activated

                        ?&gt;

                                &lt;a class="register-social-button-google" href="&lt;?php echo get_site_url(); ?&gt;/wp-login.php?loginGoogle=1" onclick="window.location = '&lt;?php echo get_site_url(); ?&gt;/wp-login.php?loginGoogle=1&amp;redirect='+window.location.href; return false;"&gt;&lt;?php _e('Login via Google', 'agrg') ?&gt;&lt;/a&gt;



                        &lt;?php } ?&gt;

                    &lt;/div&gt;

                &lt;/div&gt;


                                &lt;?php
                if(get_option('users_can_register')) { //Check whether user registration is enabled by the administrator
            ?&gt;


                &lt;div class="span4 log-forms"&gt;
                &lt;h3&gt;&lt;?php _e( 'REGISTER', 'agrg' ); ?&gt;&lt;/h3&gt;
                    &lt;form class="form-item login-form" action="" id="primaryPostForm" method="POST" enctype="multipart/form-data"&gt;

                            &lt;?php

                                        global $user_ID, $user_identity, $user_level, $registerSuccess;

                                        $registerSuccess = "";


                                        if (!$user_ID) {

                                            if(isset($_POST['answer-hidden']))

                                            {

                                                if ( $_POST['answer'] == $_POST['answer-hidden'] ) {

                                                    $user_name = $wpdb-&gt;escape($_POST['username']);

                                                    $user_email = $wpdb-&gt;escape($_POST['email']);

                                                    $password = $wpdb-&gt;escape($_POST['pwd']);

                                                    $confirm_password = $wpdb-&gt;escape($_POST['confirm']);

                                                    $user_id = username_exists( $user_name );
                                                    if ( !$user_id and email_exists($user_email) == false and !empty($user_email) and !empty($user_name) and is_email($user_email)) {
                                                        $random_password = wp_generate_password( $length=12, $include_standard_special_chars=false );
                                                        $user_id = wp_create_user( $user_name, $random_password, $user_email );
                                                        $from = get_option('admin_email');
                                                        $headers = 'From: '.$from . "\r\n";
                                                        $subject = "Registration successful";
            $msg = "Registration successful \n Your login details \n Username: $user_name \n Password: $random_password \n $login";
                                                        $headers2 = 'From: '.$user_email . "\r\n";
                                                        $subject2 = "New user register on your website.";
            $msg2 = "New user register on your website \n User details are \n Username: $user_name \n Email: $user_email";
                                                        wp_mail( $user_email, $subject, $msg,  $headers);
                                                        wp_mail( $from, $subject2, $msg2,  $headers2);
                                                        echo '&lt;span style="margin-left:-10px;margin-bottom: 10px; float: left;"&gt;'._e('Go to your inbox or spam/junk and get your password','agrg').'&lt;/span&gt;';
                                                    }elseif(email_exists($user_email) == true){
                                                        echo '&lt;span style="margin-left:-10px;margin-bottom: 10px; float: left;"&gt;'._e('This Email already exists','agrg').'&lt;/span&gt;';
                                                    }
                                                    elseif(username_exists( $user_name ) == true){
                                                        echo '&lt;span style="margin-left:-10px;margin-bottom: 10px; float: left;"&gt;'._e('This Username already exists','agrg').'&lt;/span&gt;';
                                                    }elseif(empty($user_email)){
                                                        echo '&lt;span style="margin-left:-10px;margin-bottom: 10px; float: left;"&gt;'._e('Email field is empty.','agrg').'&lt;/span&gt;';
                                                    }elseif(!is_email($user_email)){
                                                        echo '&lt;span style="margin-left:-10px;margin-bottom: 10px; float: left;"&gt;'._e('Please provide correct email.','agrg').'&lt;/span&gt;';
                                                    }elseif(empty($user_name)){
                                                        echo '&lt;span style="margin-left:-10px;margin-bottom: 10px; float: left;"&gt;'._e('Username field is empty.','agrg').'&lt;/span&gt;';
                                                    }

                                                }else{

                                                    echo '&lt;span style="margin-left:-10px;margin-bottom: 10px; float: left;"&gt;'._e('Your answer is not correct. Try again!','agrg').'&lt;/span&gt;';

                                                }

                                            }

                                        }
                            ?&gt;




                                &lt;input id="contactName" placeholder="&lt;?php _e( 'User Name', 'agrg' ); ?&gt;" type="text" name="username" class="text input-textarea half" value="" maxlength="30" /&gt;






                                    &lt;input id="email" placeholder="&lt;?php _e( 'Email Address', 'agrg' ); ?&gt;" type="text" name="email" class="text input-textarea half" value=""  maxlength="30" /&gt;
                                &lt;br/&gt;
                                    &lt;span class="pleaseanswer" style="line-height:52px;margin-left: 10px;margin-bottom: 10px; float: left;"&gt;&lt;?php _e( 'Answer this please: ', 'agrg' ); echo $rand1.'+'.$rand2 ?&gt;&lt;/span&gt;
                                &lt;br/&gt;
                                &lt;input id="email" style="width:35% !important;float: right;margin-right: 0px !important;" placeholder="&lt;?php _e( 'Your answer', 'agrg' ); ?&gt;" type="text" name="answer" class="text input-textarea half" value=""  maxlength="30" /&gt;
                                &lt;input type="hidden" name="answer-hidden" value="&lt;?php echo $rand_answer; ?&gt;" /&gt;



                                &lt;br/&gt;
                                    &lt;span style="margin-left: 10px;margin-bottom: 10px; float: left;"&gt;&lt;?php _e( 'Password will be emailed to you.', 'agrg' ); ?&gt;&lt;/span&gt;
                                &lt;br/&gt;
                                &lt;br/&gt;


                                    &lt;input type="hidden" name="submit" value="Register" id="submit" /&gt;
                                    &lt;div class="clearfix"&gt;&lt;/div&gt;
                                        &lt;button class="btn form-submit" id="edit-submit" name="op" value="Publish Ad" type="submit"&gt;&lt;?php _e('Submit', 'agrg') ?&gt;&lt;/button&gt;




                    &lt;/form&gt;



                    &lt;div class="clearfix"&gt;&lt;/div&gt;
                    &lt;div class="register-page-title"&gt;

                        &lt;h5&gt;&lt;?php _e( 'Login via Social Media', 'agrg' ); ?&gt;&lt;/h5&gt;

                    &lt;/div&gt;
                    &lt;div class="social-btn clearfix"&gt;
                        &lt;?php
                        /**
                         * Detect plugin. For use on Front End only.
                         */
                        include_once( ABSPATH . 'wp-admin/includes/plugin.php' );

                        // check for plugin using plugin name
                        if ( is_plugin_active( "nextend-facebook-connect/nextend-facebook-connect.php" ) ) {
                          //plugin is activated

                        ?&gt;

                                &lt;a class="register-social-button-facebook" href="&lt;?php echo get_site_url(); ?&gt;/wp-login.php?loginFacebook=1" onclick="window.location = '&lt;?php echo get_site_url(); ?&gt;/wp-login.php?loginFacebook=1&amp;redirect='+window.location.href; return false;"&gt;&lt;?php _e( 'Login via Facebook', 'agrg' ); ?&gt;&lt;/a&gt;


                        &lt;?php } ?&gt;

                        &lt;?php
                        /**
                         * Detect plugin. For use on Front End only.
                         */
                        include_once( ABSPATH . 'wp-admin/includes/plugin.php' );

                        // check for plugin using plugin name
                        if ( is_plugin_active( "nextend-twitter-connect/nextend-twitter-connect.php" ) ) {
                          //plugin is activated

                        ?&gt;

                                &lt;a class="register-social-button-twitter" href="&lt;?php echo get_site_url(); ?&gt;/wp-login.php?loginTwitter=1" onclick="window.location = '&lt;?php echo get_site_url(); ?&gt;/wp-login.php?loginTwitter=1&amp;redirect='+window.location.href; return false;"&gt;&lt;?php _e( 'Login via Twitter', 'agrg' ); ?&gt;&lt;/a&gt;


                        &lt;?php } ?&gt;

                        &lt;?php
                        /**
                         * Detect plugin. For use on Front End only.
                         */
                        include_once( ABSPATH . 'wp-admin/includes/plugin.php' );

                        // check for plugin using plugin name
                        if ( is_plugin_active( "nextend-google-connect/nextend-google-connect.php" ) ) {
                          //plugin is activated

                        ?&gt;


                                &lt;a class="register-social-button-google" href="&lt;?php echo get_site_url(); ?&gt;/wp-login.php?loginGoogle=1" onclick="window.location = '&lt;?php echo get_site_url(); ?&gt;/wp-login.php?loginGoogle=1&amp;redirect='+window.location.href; return false;"&gt;&lt;?php _e( 'Login via Google', 'agrg' ); ?&gt;&lt;/a&gt;


                        &lt;?php } ?&gt;

                    &lt;/div&gt;


                &lt;/div&gt;


            &lt;?php }

                else echo "&lt;span class='registration-closed'&gt;"._e('Registration is currently disabled. Please try again later.','agrg')."&lt;/span&gt;";

            ?&gt;


                &lt;div class="span4 log-forms"&gt;
                    &lt;h3&gt;&lt;?php _e( 'FORGOT PASSWORD', 'agrg' ); ?&gt;&lt;/h3&gt;
                            &lt;form class="form-item login-form" action="" id="primaryPostForm" method="POST" enctype="multipart/form-data"&gt;

                                &lt;?php if($_POST) {

                                    echo "&lt;div id='result' style='margin-bottom: 30px;'&gt;&lt;div class='message'&gt;&lt;span&gt;".$message."&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;";

                                } ?&gt;

                                    &lt;?php if($resetSuccess == 1) {

                                } else { ?&gt;


                                        &lt;input id="email" placeholder="&lt;?php _e('Email Address','agrg'); ?&gt;" type="text" name="email" class="text input-textarea half" value="" maxlength="30" /&gt;

                                        &lt;span class="help-text"&gt;&lt;?php _e( 'Put your email address for reset password.', 'agrg' ); ?&gt;&lt;/span&gt;

                                        &lt;input type="hidden" name="submit" value="Reset" id="submit" /&gt;
                                        &lt;div class="clearfix"&gt;&lt;/div&gt;

                                            &lt;button class="btn form-submit" id="edit-submit" name="op" value="Publish Ad" type="submit"&gt;&lt;?php _e('SUBMIT NOW', 'agrg') ?&gt;&lt;/button&gt;



                                &lt;?php } ?&gt;

                            &lt;/form&gt;

                            &lt;div class="clearfix"&gt;&lt;/div&gt;

                    &lt;div class="register-page-title"&gt;

                        &lt;h5&gt;&lt;?php _e( 'Login via Social Media', 'agrg' ); ?&gt;&lt;/h5&gt;

                    &lt;/div&gt;
                &lt;div class="social-btn clearfix"&gt;
                        &lt;?php
                        /**
                         * Detect plugin. For use on Front End only.
                         */
                        include_once( ABSPATH . 'wp-admin/includes/plugin.php' );

                        // check for plugin using plugin name
                        if ( is_plugin_active( "nextend-facebook-connect/nextend-facebook-connect.php" ) ) {
                          //plugin is activated

                        ?&gt;

                                &lt;a class="register-social-button-facebook" href="&lt;?php echo get_site_url(); ?&gt;/wp-login.php?loginFacebook=1" onclick="window.location = '&lt;?php echo get_site_url(); ?&gt;/wp-login.php?loginFacebook=1&amp;redirect='+window.location.href; return false;"&gt;&lt;?php _e( 'Login via Facebook', 'agrg' ); ?&gt;&lt;/a&gt;

                        &lt;?php } ?&gt;

                        &lt;?php
                        /**
                         * Detect plugin. For use on Front End only.
                         */
                        include_once( ABSPATH . 'wp-admin/includes/plugin.php' );

                        // check for plugin using plugin name
                        if ( is_plugin_active( "nextend-twitter-connect/nextend-twitter-connect.php" ) ) {
                          //plugin is activated

                        ?&gt;

                                &lt;a class="register-social-button-twitter" href="&lt;?php echo get_site_url(); ?&gt;/wp-login.php?loginTwitter=1" onclick="window.location = '&lt;?php echo get_site_url(); ?&gt;/wp-login.php?loginTwitter=1&amp;redirect='+window.location.href; return false;"&gt;&lt;?php _e( 'Login via Twitter', 'agrg' ); ?&gt;&lt;/a&gt;

                        &lt;?php } ?&gt;

                        &lt;?php
                        /**
                         * Detect plugin. For use on Front End only.
                         */
                        include_once( ABSPATH . 'wp-admin/includes/plugin.php' );

                        // check for plugin using plugin name
                        if ( is_plugin_active( "nextend-google-connect/nextend-google-connect.php" ) ) {
                          //plugin is activated

                        ?&gt;

                                &lt;a class="register-social-button-google" href="&lt;?php echo get_site_url(); ?&gt;/wp-login.php?loginGoogle=1" onclick="window.location = '&lt;?php echo get_site_url(); ?&gt;/wp-login.php?loginGoogle=1&amp;redirect='+window.location.href; return false;"&gt;&lt;?php _e( 'Login via Google', 'agrg' ); ?&gt;&lt;/a&gt;


                        &lt;?php } ?&gt;

                    &lt;/div&gt;


                &lt;/div&gt;


        &lt;/div&gt;


    &lt;/div&gt;

&lt;/section&gt;
</code></pre>
<p dir="auto">&lt;?php get_footer(); ?&gt;</p>
<p dir="auto">[/PHP]</p>
]]></description><link>https://connect.gt/topic/226052/redirect-dopo-registrazione</link><generator>RSS for Node</generator><lastBuildDate>Sun, 19 Apr 2026 11:48:55 GMT</lastBuildDate><atom:link href="https://connect.gt/topic/226052.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 11 Oct 2016 16:27:19 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Redirect dopo registrazione on Fri, 14 Oct 2016 08:40:18 GMT]]></title><description><![CDATA[<p dir="auto">Ciao Giak3,<br />
esiste un plugin che fa quello che cerchi:** Peter's Login Redirect **<br />
Hai provato a usarlo?</p>
]]></description><link>https://connect.gt/post/1228517</link><guid isPermaLink="true">https://connect.gt/post/1228517</guid><dc:creator><![CDATA[glorialchemica]]></dc:creator><pubDate>Fri, 14 Oct 2016 08:40:18 GMT</pubDate></item></channel></rss>