-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathErroHandling.php
More file actions
46 lines (40 loc) · 1.28 KB
/
ErroHandling.php
File metadata and controls
46 lines (40 loc) · 1.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<!DOCTYPE html>
<!--
To change this license header, choose License Headers in Project Properties.
To change this template file, choose Tools | Templates
and open the template in the editor.
-->
<html>
<head>
<meta charset="UTF-8">
<title></title>
</head>
<body>
<?php
function customError($errno, $errstr) {
echo "<b>Error:</b> [$errno] $errstr<br>";
//die(Error);
}
set_error_handler("customError");
if(!file_exists("welcome.txt") && 1 != 1) {
die("File not found");
} else {
$file=fopen("welcome.txt","r");
}
echo "<br>";
$test=2;
if ($test>=1) {
trigger_error("Value must be 1 or below");
}
$to = "[email protected]";
$subject = "My subject";
$txt = "Hello world!";
"CC: [email protected]";
mail($to,$subject,$txt,$headers);
?>
<hr>
<b>die(message):</b> will show a message and terminate to process
of page.
</body>
</html>