Dynadot Aftermarket: discover domain gems worth investing in. Visit our aftermarket.

Need help with contact form

SpaceshipSpaceship
Namecheap AuctionsNamecheap Auctions
Namecheap AuctionsNamecheap Auctions
Watch

hangman21

Established Member
Impact
1
here is my code and i want to redirect my thank you page, how can i do that? thanks

<?php
// Contact subject
$subject ="$subject";
// Details
$message="$message";

// Mail of sender
$mail_from="$email";
// From
$header="from: $name <$mail_from>";

// Enter your email address
$to ='[email protected]';

$send_contact=mail($to,$subject,$message,$header);

// Check, if message sent to your email
// display message "We've recived your information"
if($send_contact){
echo "www.mywebsite.com/thankyou";
}
else {
echo "ERROR";
}
?>
 
0
Close
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
Instead of the "echo" ...
header("Location:www.mywebsite.com/thankyou");

Hopefully you're sanitizing those variables someplace earlier in the code?
 
0
Close
add this to the "additional settings" section:

on_sent_ok: "location.replace('http://www.YOURSITE.com');"
 
0
Close
AIVikingsAIVikings

We're social

Escrow.com
Spaceship
Domain Recover
CryptoExchange.com

NamePros updates

A browser tab with a favicon next to the page title
Search members
You can now search for members by name, company, location and more. Open the search at the top of any page and choose Members. You will...
AIVikings
Catchy
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back