WordPress.org

Ready to get started?Download WordPress

Forums

Form Maker
[resolved] Redirect to different pages based on form input (2 posts)

  1. wzshop
    Member
    Posted 1 week ago #

    Hi,
    Is it possible to redirect to different pages, based on the form inputs?
    Thanks!

    https://wordpress.org/plugins/form-maker/

  2. wzshop
    Member
    Posted 1 week ago #

    Ok this is what i did: In form-maker\frontend\models\FMModelForm_maker.php

    Go to line: 7613 and find if (!$str) {.
    Here I changed it in the following code to get a custom redirect based on the option selected from a dropdown menu:

    if (!$str) {
    //Custom redirect script
    if($_POST['select name'] == 'Value option selected'){
    $redirect_url = 'http://domain.com/url-1.htm';
    }
    else{
    	$redirect_url = 'http://domain.com/url-2.htm';
    }
    
          wp_redirect($redirect_url);
    
          exit;
    
        }

    No idea if this is neat, but it is working:) Suggestions are welcome.

Reply

You must log in to post.

About this Plugin

About this Topic

Tags

No tags yet.