Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript redirect to thankyou page with self posting php email form. Pretty please :) Re: redirect to thankyou page with self posting php email form. Pretty please :)

#82461
rubistarr
Member

sadly, that just makes the form say the word success above the form when it is successfully sent. Do you think it is something where the code above is overriding the code below? so the form will not redirect to the separate page? I agree guessing is not the best approach but I combine it with lots of internet research and then try things in the hopes it will work. It has gotten me this far but It appears I may have met my match :P


$.post('http://getgraphixed.com/RSD_new/wp-content/themes/fullscreen_child/scripts/contact-process.php', {name: input_name, email: input_email, subject: input_subject, message: input_message}, function(data){
if ( data === 'success' )
{
window.location = "http://www.google.com/"
}
else

and

if(empty($errors))
{
if(mail('[email protected]', "Message from $input_name - $input_subject", $input_message, "From: $input_email"))
{
echo 'success';
}
else
{
echo 'There was an issue when sending your email. Please try again.';
}

Do I need some sort of on the actual contact form page perhaps?