0

I want to issue a popup or something to remind users to perform a second action after the first action is done. The first action is

fwrite($fp, $str);
$read = fread($fp, 16);
$read = explode(";", $read);
if ($read[0] != "OK") {
    echo "Write Error";
    fclose($fp);
} else {
    $send = substr($str, 3);
    verification($send, $fp);
}

and the second action is verification().

Before the verification(), I want to make something that reminds user that the first action is finished. Either a popup or something like that.

bfavaretto
  • 71,580
  • 16
  • 111
  • 150

2 Answers2

0

It's possible to write a javascript alert:

<script>window.alert('insert reminder here');</script>

After that, use php's flush() command to output everything up to that point to the browser, but you may have difficulty doing that before completing the if statement.

cereallarceny
  • 4,913
  • 4
  • 39
  • 74
jerebear
  • 6,503
  • 4
  • 31
  • 38
0

You cannot use javascript in PHP,html and javascript will run after php script is interpreted. To do what you want you must place verification() in another page,alert after your first action then redirect to another page which do verification().

Persk
  • 639
  • 2
  • 6
  • 15