Hello,

I am using Drupal 6.17 and webform 6.x-3.0-beta 6. I install Webform_PHP I put the redirect url code $node->webform['confirmation'] = 'internal:node/1'; in the addtional processing field, but it does nothing, only redirect to the same page and there is a "thanks your submission" message display on that page.

how can i redirect to other specific pages.

thanks very much if can give me a little help.

Comments

quicksketch’s picture

It's now "redirect_url" instead of "confirmation". The confirmation is now used explicitly for confirmation text.

$node->webform['redirect_url'] = 'node/1'; 

You also no longer need to use "internal:" in the URL, since Webform doesn't need to figure out if it's text or a URL any more.

cobee’s picture

Thanks quicksketch replay so quick

but it is still not working when i put this code in addtional processing field, it's still redirect to the confirmation message page. I have no idea what's wrong with it, is there anything need to modify or do i need to create a custom module. Is there anything wrong with my drupal or the module.

Thanks again.

quicksketch’s picture

Status: Active » Closed (won't fix)

Hm, guess you're on your own then. I'm not officially supporting Webform PHP in any way. If you do find the solution, please post it here for others, but I'm unable to provide support on writing custom code.

DrupalKing’s picture

I would like an answer regarding "redirect_url". It does not work, nor does "confirmation". Any hints?

jennypanighetti’s picture

Version: 6.x-3.0-beta6 » 6.x-3.1

Sorry, but I'm having the same problem. I am trying to use webform_php to do a dynamic redirect, and nothing happens.

I can set the URL ($node->webform['redirect_url']), then output it to error_log and see that the change is correct, but it's like webform doesn't DO anything with the change.

If I put a page or URL in the webform redirect box, it works fine.

Is there any way I can put code in a module hook to execute after webform saves?

Thanks in advance to anybody but quicksketch since I know he won't help. But would appreciate user feedback.
Jenny

goodwillhinton’s picture

I am having the exact same problem with this. Anyone have any luck resolving this issue?

Thanks!

ainz’s picture

That code doesn't work in webform php module. Look at what the maintainer had to say here. http://drupal.org/node/864010#comment-3334588

ainz’s picture

This worked for me: http://www.vilepickle.com/blog/2010/11/11/0086-redirect-webform-submissi...

It looks confusing at first but if you look at it, its quite simple:

Firstly the code he uses in Additional Processing to some extent adds to the confusion:

  if ($form_values['submitted_tree']['fieldset']['fieldname_under_fieldset'] == '0' && $form_values['submitted_tree']['fieldset_last_page']['fieldname_under_fieldset'])
 
   {
    $_SESSION['exredirect']['redirect_url'] = 'http://example.org/submitted?s=n';
  }else{
    $_SESSION['exredirect']['redirect_url'] = 'http://example.org/submitted?s=y';
}

Just use whatever if statement resolves TRUE for your particular webform based on your fieldnames. I used:

  if ($form_values['submitted_tree']['participant_type'] == 'international_participant')
    {
    $_SESSION['exredirect']['redirect_url'] = 'http://example.org/submitted?participant=int';
  }else{
    $_SESSION['exredirect']['redirect_url'] = 'http://example.org/submitted?participant=local';
}

Dont forget if you changed the name of the variable being passed you have to change it in the php code on the submitted page as well.