ArK
ArK

Reputation: 21076

how can i make php alert pop ups just like in javascript

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.

Upvotes: 0

Views: 519

Answers (3)

meder omuraliev
meder omuraliev

Reputation: 186762

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');
}

Upvotes: 3

Pascal MARTIN
Pascal MARTIN

Reputation: 401182

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).

Upvotes: 1

Sam Bisbee
Sam Bisbee

Reputation: 4441

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.).

Upvotes: 2

Related Questions