Skip to main content
added 320 characters in body
Source Link
Balas
  • 621
  • 5
  • 17

See my updated answer, now i tried as per your condition and my url is like now

i tried as per your condition and my url is like now

http://www.example.com/?query=yes
    
add_action('init', 'my_cookie');

add_action('init', 'signup_validate_insert');

function signup_validate_insert() {
    if(isset($_REQUEST['query'])) {     
        $errors = 'my_error';
        setcookie("my_cookie", $errors, time()+3600);       
        wp_redirect(home_url('my_redirect_page''shortcode-9/'));
        die();
    }
} 

function my_cookie() {
    if(isset($_COOKIE['my_cookie'])) {
        
        echo $_COOKIE['my_cookie'];
    }
}
    
    it is for me working nice. am i right? Reply your thoughts.
i tried as per your condition and my url is like now

http://www.example.com/?query=yes

add_action('init', 'signup_validate_insert');

function signup_validate_insert() {
    if(isset($_REQUEST['query'])) {
        wp_redirect(home_url('my_redirect_page'));
        die();
    }
}

it is for me working nice. am i right? Reply your thoughts.

See my updated answer, now i tried as per your condition and my url is like now

    http://www.example.com/?query=yes
    
add_action('init', 'my_cookie');

add_action('init', 'signup_validate_insert');

function signup_validate_insert() {
    if(isset($_REQUEST['query'])) {     
        $errors = 'my_error';
        setcookie("my_cookie", $errors, time()+3600);       
        wp_redirect(home_url('shortcode-9/'));
        die();
    }
} 

function my_cookie() {
    if(isset($_COOKIE['my_cookie'])) {
        
        echo $_COOKIE['my_cookie'];
    }
}
    
    it is for me working nice. am i right? Reply your thoughts.
Source Link
Balas
  • 621
  • 5
  • 17

i tried as per your condition and my url is like now

http://www.example.com/?query=yes

add_action('init', 'signup_validate_insert');

function signup_validate_insert() {
    if(isset($_REQUEST['query'])) {
        wp_redirect(home_url('my_redirect_page'));
        die();
    }
}

it is for me working nice. am i right? Reply your thoughts.