html - Print php output in pop window on submitting the form


I would like to print the output of PHP in a pop window after the submission of html form. Below is sample of my code.

    if("condition match")
       echo "output1";
       echo "output2";
<form class='n-form' action='#' method='post'>
  <button type='submit' name="button1" class='button'>Submit</button>
    <a href="../home.php" class="button">Cancel</a>

It should be able to print the echo output in the pop window based on the if condition.

Looking forward to hear.




There is no popout windows in php you have to do it in javascript

    $text = (isset($_POST['button1'])) ? "output1" : "output2";
    echo '<script>alert("' . $text . '")</script>';

People are also looking for solutions to the problem: php - How to get notification when a new text is added to a file?


Didn't find the answer?

Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.

Ask a Question

Write quick answer

Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.

Similar questions

Find the answer in similar questions on our website.