Question

i need a pop up window which asks me before proceeding to next like alert in javascript.

Is any built in facility in PHP like that.

Was it helpful?

Solution

PHP is a server-side language - you generate HTML/JS from it, the browser doesn't see PHP because it interprets the actual file PHP/server outputs.

You probably want the window.confirm method:

var continueOn = window.confirm('proceed?');

if ( continueOn ) {
    alert('go on');
} else {
    alert('exit');
}

OTHER TIPS

No, PHP is server side.

The best that you can do is to have PHP output HTML/JS that creates pop ups (whether they're floating divs, JS alerts, etc.).

Considering PHP is executed on the server-side, you cannot have this kind of "pop-up" in PHP : you'll have to go with some Javascript code, that's executed on the client-side (ie, in the user's browser).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top