How to open a new window from within a php script

Discussion in 'PHP' started by countrydj, Dec 7, 2010.

  1. #1
    Hi..

    I have a php script for sending emails from a form
    I use contact.tpl and contact.php
    contact.tpl collectes the data and passes it to contact.php.
    This works fine.
    Then contact.php sends a thank you message withing the same page.
    I want for contact.php to send a thank you message to a new page.
    Can anybody tell me how to do it.

    Here is the script (shortened) for sending the thank you message:

    $content = "<table align=center width=600 cellpadding=0 cellspacing=0 border=0><tr><td colspan=2>";
    $content .= "<center><br /><br /><font size=4 ><b>Hi $name.....</b><br /><br /></center>\n";
    $content .= "<center><font size=5 ><b>Thank you for taking the time to contact us.</b><br /><br /></center>\n";
    $content .= "</td></tr></table></center><br>";

    print $content;

    Thanks for any advise.

    John C
     
    countrydj, Dec 7, 2010 IP
  2. underground-stockholm

    underground-stockholm Guest

    Messages:
    53
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #2
    The PHP script can print some JavaScript code, that will open a new window.
     
    underground-stockholm, Dec 7, 2010 IP
  3. countrydj

    countrydj Active Member

    Messages:
    41
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    91
    #3
    I was hoping that this would be the case, but the PHP script needs a little help from me and I don't know how to help.
    This is why I am asking for help.

    John C
     
    countrydj, Dec 7, 2010 IP
  4. nadeem3366

    nadeem3366 Member

    Messages:
    28
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    36
    #4
    Hi,

    means you are filling form from contact.php while the fields which are appearing on contact.php these are coming from contact.tpl right ?

    so when you are filling data it goes some where for emailing, may be on contact.php or contact.tpl, so after emailing the you must give header location for new window like thanks.php where you must pass the things which you want on thanks page. i think its not a big problem.

    Regards,
    Nadeem A.
     
    nadeem3366, Dec 7, 2010 IP
  5. countrydj

    countrydj Active Member

    Messages:
    41
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    91
    #5
    Hi nadeem3366..
    thanks for your input here.
    However, I have just put my brain into gear and realised what to do.

    All I need to do is to state target="new" in the form parameters.

    Thanks to everybody who took the trouble to look.

    John C
     
    countrydj, Dec 7, 2010 IP
  6. openbytes

    openbytes Peon

    Messages:
    15
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Like a popup?
     
    openbytes, Dec 7, 2010 IP
  7. nadeem3366

    nadeem3366 Member

    Messages:
    28
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    36
    #7
    Hi countrydj,

    If you like to send me these 2 files, i will be also happy to solve that problem for you.

    Have a Nice Day!
    ..Nadeem
     
    nadeem3366, Dec 7, 2010 IP
  8. countrydj

    countrydj Active Member

    Messages:
    41
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    91
    #8
    Hi nadeem3366..
    I have already solved the problem (see 3 posts up), THANKS.
    However, I do have another problem which I will post in a more appropriate thread.
    I will PM you with the problem.

    Cheers,

    John C
     
    countrydj, Dec 8, 2010 IP