Обновление после сохранения
Добрый день подскажите, как обновить страницу после нажатия кнопки сохранить.
То есть я поменял данный нажимаю сохранить. он мне выдаешь ошибку "отправка повторной формы"
Данные сохраняться но страница не обновляется. Где косяк допустил ?
<?php global $user_ID, $user_identity;get_currentuserinfo(); if (!$user_ID): ?> <div class="opovechenue">Чтобы использовать профиль, нужно <a href="/pf.php/">войдите или зарегистрируйтесь</a> на сайте.</div> <?php else: ?> <div class="grid2"> <div class="fonsot"> <div class="avatar"><?php echo get_avatar($current_user->id, ' . $current_user->id'); ?></div> <p></p> <div class="text-centr">Добро пожаловать: <?php _e(' '); ?><?php echo $user_identity; ?></div> <p></p> <?php ulogin_synchronisation_panel(); ?> <div class="opovechenue">Чтобы установить аватарку, зарегистриуйтесь на gravatar.com и установите там картинку.</div> </div> <div class="fonsot"> <?php /* Имя шаблона: Профиль пользователя */ global $current_user, $wp_roles; get_currentuserinfo(); /* Если профиль был сохранен, обновить профиль. */ if ( 'POST' == $_SERVER['REQUEST_METHOD'] && !empty( $_POST['action'] ) && $_POST['action'] == 'update-user' ) { /* Обновление пароля пользователя. */ if ( !empty($_POST['pass1'] ) && !empty( $_POST['pass2'] ) ) { if ( $_POST['pass1'] == $_POST['pass2'] ) wp_update_user( array( 'ID' => $current_user->id, 'user_pass' => esc_attr( $_POST['pass1'] ) ) ); else $error = __('Введенные пароли не совпадают. Ваш пароль не был обновлен.', 'profile');} /* Обновление информации о пользователе. */ if ( !empty( $_POST['first-name'] ) ) update_usermeta( $current_user->id, 'first_name', esc_attr( $_POST['first-name'] ) ); if ( !empty( $_POST['last-name'] ) ) update_usermeta($current_user->id, 'last_name', esc_attr( $_POST['last-name'] ) ); if ( !empty( $_POST['description'] ) ) update_usermeta( $current_user->id, 'description', esc_attr( $_POST['description'] ) ); if ( !empty( $_POST['skype'] ) ) update_usermeta( $current_user->id, 'skype', esc_attr( $_POST['skype'] ) ); if ( !empty( $_POST['telefon'] ) ) update_usermeta( $current_user->id, 'telefon', esc_attr( $_POST['telefon'] ) ); if ( $_POST['user_email']) wp_update_user( array( 'ID' => $current_user->id, 'user_email' => esc_attr( $_POST['user_email'] ) ) ); if ( $_POST['user_url']) wp_update_user( array( 'ID' => $current_user->id, 'user_url' => esc_attr( $_POST['user_url'] ) ) ); if ( $_POST['display_name']) wp_update_user( array( 'ID' => $current_user->id, 'display_name' => esc_attr( $_POST['display_name'] ) ) ); /* Перенаправление поэтому страница покажет обновленную информацию. */ if ( !$error ) { wp_redirect( get_permalink() ); exit;}} ?> <div> <form method="post" id="adduser" action="<?php the_permalink(); ?>"> <div class="personal-info"> <h2>Ваши данные:</h2> <div><label for="last-name" class="laberform"><?php _e('Фамилия: ', 'profile'); ?></label><input class="text-input" name="last-name" type="text" id="last-name" value="<?php the_author_meta( 'user_lastname', $current_user->id ); ?>" /></div> <div><label for="first-name" class="laberform"><?php _e('Имя: ', 'profile'); ?></label><input class="text-input" name="first-name" type="text" id="first-name" value="<?php the_author_meta( 'user_firstname', $current_user->id ); ?>" /></div> <div><label for="user_url" class="laberform"><?php _e('Ваш сайт: ', 'profile'); ?></label><input class="text-input" name="user_url" type="text" id="url" value="<?php the_author_meta( 'user_url', $current_user->id ); ?>" /></div> <div><label for="telefon" class="laberform"><?php _e('Телефон: ', 'profile'); ?></label><input class="text-input" name="telefon" type="text" id="url" value="<?php the_author_meta( 'telefon', $current_user->id ); ?>" /></div> <div><label for="user_email" class="laberform"><?php _e('Почта: ', 'profile'); ?></label><input class="text-input" name="user_email" type="text" id="email" value="<?php the_author_meta( 'user_email', $current_user->id ); ?>" /></div> <div><label for="display_name" class="laberform"><?php _e('Показывать: ', 'profile'); ?></label><input class="text" name="display_name" type="text" id="url" value="<?php the_author_meta( 'display_name', $current_user->id ); ?>" /></div> </div> <h2>Дополнительная информация:</h2> <label for="description"><?php _e('', 'profile') ?></label> <textarea name="description" id="description" rows="4" cols="50"><?php the_author_meta( 'description', $current_user->id ); ?></textarea> <p></p> <h2>Изменить пароль:</h2> <label for="pass1"><?php _e('', 'profile'); ?> </label><input class="text-input" name="pass1" type="password" id="pass1" placeholder="Новый пароль" /> <label for="pass2"><?php _e('', 'profile'); ?></label><input name="pass2" type="password" class="text-input" id="pass2" placeholder="Повторите пароль" /> <?php echo $referer; ?><input name="updateuser" type="submit" id="updateuser" class="submit button" value="<?php _e('сохранить', 'profile'); ?>" style="float: right;margin-bottom: 20px;" /> <?php wp_nonce_field( 'update-user' ) ?><input name="action" type="hidden" id="action" value="update-user" /> </div> </form> </div> </div> <p></p> <?php endif; ?>
Решил вопрос