I've have been trying to redirect the page after user_save in drupal 7. I have scenario in which a webform is used for registration process.when the users submits the webform ,it should be saved as a user in database and redirect to a 'test_page' .so i have tried
function custom_module_webform_submission_insert($node, $submission){
$user=array(
'name'=>$submission['data'][0]['value'];
'pass'=>$submission['data'][1]['value'];
'mail'=>$submission['data'][2]['value'];
);
user_save('',$user);
drupal_goto('test_page');
}
After saving the user, the page is redirected to '/user' page instead of 'test_page'