1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

php pop up window help

Discussion in 'PHP & Perl' started by l30st0wn, Jan 31, 2012.

  1. l30st0wn

    l30st0wn Newbie

    Joined:
    Oct 24, 2011
    Messages:
    4
    Likes Received:
    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?
     
  2. artizhay

    artizhay BANNED BANNED

    Joined:
    Nov 21, 2010
    Messages:
    1,867
    Likes Received:
    1,335
    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?
     
  3. inviz

    inviz Newbie

    Joined:
    Jun 15, 2010
    Messages:
    45
    Likes Received:
    5
    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.
     
  4. randomnumbers

    randomnumbers Newbie

    Joined:
    Jun 18, 2011
    Messages:
    20
    Likes Received:
    2
    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!';
    }