for page redirection in wordpress plugin m using php header function
my code is
$URL = admin_url('admin.php?page=myaccount&success=yes');
header("location:".$URL);
exit();
it gives me error like this.
Warning: Cannot modify header information - headers already sent by (output started at /home/fusionmark/public_html/wp/wp-admin/includes/template.php:1877) in /home/fusionmark/public_html/wp/wp-content/plugins/JVZoo/includes.php on line 258
use wp_safe_redirect() function
$redirect = admin_url('admin.php?page=myaccount&success=yes');
wp_safe_redirect($redirect);
die();
$URL = admin_url('admin.php?page=myaccount&success=yes');
header("location:".$URL);
exit();
instead of use:
$location = admin_url('admin.php?page=myaccount&success=yes');
wp_redirect( $location);
exit;
whatever redirect hook you can use but it place before get_header();