codepad
[
create a new paste
]
login
|
about
Language:
C
C++
D
Haskell
Lua
OCaml
PHP
Perl
Plain Text
Python
Ruby
Scheme
Tcl
<?php //....code error("Field Name is too short, minimum is 12 characters (20 max)."); error("Random Error"); error("Random Error 2"); //.. some code //at the end of the file: displayErrors(); function error($msg){ if(!isset($_SESSION['errors'])) $_SESSION['errors'] = array(); $_SESSION['errors'][] = $msg; } function displayErrors(){ foreach($_SESSION['errors'] as $err){ echo $err.'<br/>'.PHP_EOL; } unset($_SESSION['errors']); } ?>
Private
[
?
]
Run code
Submit