Skip to content

Instantly share code, notes, and snippets.

@bkamapantula
Created July 16, 2012 20:11
Show Gist options
  • Save bkamapantula/3124743 to your computer and use it in GitHub Desktop.
Save bkamapantula/3124743 to your computer and use it in GitHub Desktop.
Using Javascript alert box in PHP
<?php
echo "<script language='javascript'>alert('Try to be nice, OK? Please try again :-) ')</script>";
?>
@MohdRif
Copy link

MohdRif commented Jul 12, 2018

why my alert box is dismissed automatically

@PassCody
Copy link

PassCody commented Jul 15, 2019

do you use the an header function in your code?

If yes try this:

alert('Try to be nice, OK? Please try again :-) ')</script>"; sleep(10); myHeaderFunctions(); function myHeaderFunctions() { header('Location: '); } ?>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment