Reputation: 39
Is it possible to make a pop up window in my existing script?
session_start();
$_SESSION['success'] = ($result) ? TRUE : FALSE;
header('location: inv_fc.php');
session_start();
if ($_SESSION['success'] == TRUE) {
// CREATE POP UP WINDOW SUCCESS
} else {
// CREATE POP UP WINDOW FAILURE
}
Upvotes: 3
Views: 45014
Reputation: 146360
<?php if ($_SESSION['success'] == TRUE)?>
<script>window.open(...);alert('Your Awesome!');</script>
<?php else ?>
<script>window.open(...);alert('You Fail!!');</script>
<?php endif; ?>
Upvotes: -1
Reputation: 9059
You could open a pop-up using javascript or target a's attribute, but it's impossible from PHP, which is executed at server side.
Edit: ok, as I saw the <script>
things: it's not PHP, it's Javascript, from PHP it's not possible.
Upvotes: 3