POP UP Confirmation

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • reloi
    New Member
    • Jan 2010
    • 1

    #1

    POP UP Confirmation

    Hey everyone...

    I have a .PHP code for a simple contact form on a website:

    Code:
    <?php
    if(isset($_POST['submit'])) {
    
    $to = "email@emailsite.com";
    $subject = "SUBJECT HERE";
    $Name_field = $_POST['Name'];
    $Phone_field = $_POST['Phone'];
    $Email_field = $_POST['Email'];
    $Comments = $_POST['Comments'];
     
    $body = "From: $Name_field\n Phone Number: $Phone_field\n E-Mail: $Email_field\n Comments: $Comments\n";
     
    echo "Thank you for your interest. We will respond as soon as we can.";
    mail($to, $subject, $body);
    
    } else {
    
    echo "We're sorry. There appears to be an error. Please try again later.";
    
    }
    ?>
    I want to know how to turn the echos into a pop up dialog box after the user clicks submit, rather than have it go to a blank page saying the text that's there.

    Can someone help me?

    (p.s. I am NOT very good with PHP)
    Last edited by Dormilich; Jan 21 '10, 09:43 PM. Reason: Please use [code] tags when posting code
  • Dormilich
    Recognized Expert Expert
    • Aug 2008
    • 8694

    #2
    this is nothing you can do with PHP alone. a pop-up belongs to user interactions and is thus in the responsibility of JavaScript (although you can pass JavaScript code to the page based on a certain condition). keep in mind that this won’t work, if JavaScript is disabled.

    Comment

    Working...