Advertisement
Guest User

Untitled

a guest
Jul 13th, 2012
188
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. add_filter("gform_confirmation", "custom_confirmation", 10, 4);
  2. function custom_confirmation($confirmation, $form, $lead, $ajax){
  3. $redirurl = $_POST["input_6"];
  4. if($form["id"] == "1"){
  5. $confirmation = array();
  6. $confirmation['redirect'] = $redirurl;
  7. }
  8. return $confirmation;
  9. }
  10.  
  11. add_filter("gform_pre_render_1", "redirecturl");
  12. add_filter("gform_admin_pre_render_1", "redirecturl");
  13. function redirecturl($form){
  14. foreach($form["fields"] as &$field){
  15. if($field["id"] == 6){
  16. $field["defaultValue"] = $_SERVER['HTTP_REFERER'];
  17. }
  18. }
  19. return $form;
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement