php pop up window help

l30st0wn

Newbie
Joined
Oct 24, 2011
Messages
4
Reaction score
0
Code:
<?php

$email_to = "email address"; // your email address
$email_subject = "Contact Form Message"; // email subject line
$thankyou = "/contact/thankyou.html"; // thank you page

// if you update the question on the form -
// you need to update the questions answer below
$antispam_answer = "25";

?>

I want $thankyou to be a popup window is there a way to do this?
 
You have to use javascript for popup windows and they usually cannot be safely opened (i.e. not blocked by pop-up blockers) unless there is a matching event, such as a mouse click. Perhaps using a method other than a popup would be best?
 
I recommend that you use a jQuery modal window for this, then you could just add a "OnClick" event on your submit button and include /contact/thankyou.html as an iframe!

Google "jQuery modal plugin" and there will be tons of plugins you could easily implent.
 
I dont think its a good idea to use a popup window just for the sole purpose of thanking your visitors for their message. Some of them would probably not even see it(popup blockers).

You could do something like this on the submit target page:


Code:
if(isset($_POST['msg'])){
echo 'Thank you!';
}
 
Back
Top