Problems with redirect on contact form

后端 未结 2 947
余生分开走
余生分开走 2021-01-29 06:57

I cant figure out why this wont redirect when everything looks in place.

I have used Location /path but just doesn\'t move from the main page.

Email sends and fo

2条回答
  •  醉梦人生
    2021-01-29 07:28

    php

    if (mail($to, $subject, $message, $headers)) {
        echo $redirect_thankyou; 
        die(); 
    } 
    else 
    { 
        echo $redirect_error"; 
        die(); 
    } 
    

    javascript

    $.post("hero-form.php", $("#register-form").serialize(),function(result){
        if(result){
           location.replace(result);
           $('#hero-success-notification').addClass('show-up');
           $('#hero-submit').addClass('disabled');
        }
    });
    

提交回复
热议问题