Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
By najubudeen on
hi, i am creating a module form. when i submit, it is redirected to a page. after reload the whole page for X seconds, the page again is redirected to user profile page. i tried using inline javascript.
every things work correctly, but the path doesn't get overlay path, i have written my codes below. i want the overlay path to be like this http://example.com/drupal/#overlay=my_page/yes.
i tried some thing like below. it doesn't work.
the url into inline javascript prints the path like this http://example.com/drupal/my_page/yes. My path should be http://example.com/drupal/#overlay=my_page/yes.
function my_callback_page($check_page = ''){
$output = '';
global $user;
global $base_url;
drupal_add_js('jQuery(document).ready(function($) {window.setTimeout(function(){window.location.href ="'.$base_url.'/my_page/yes"},2000);});', 'inline');
if( $check_page == 'yes'){
drupal_goto('user/'.$user->uid.'/edit');
}
return $output;
}