Reply
Sat 23 Apr, 2016 07:39 am
I have to define named constants for the following error messages and list their names and values in a table.
File not found
File cannot be read
File cannot be written
File cannot be deleted
File cannot be renamed
below is my code; but I don`t know if I have written it correctly!
<!DOCTYPE html>
<title>Practical8</title>
<html>
<body>
<?php
define("NOFILE", "File not found");
define("NOTREAD", "File cannot be read");
define("NOTWRITTEN", "File cannot be written");
define("NOTDELETED", "File cannot be deleted");
define("NOTRENAMED", "File cannot be renamed");
$str = <<<TAB
<table border="1" style="width:100%">
<tr>
<td>{"NOFILE"}</td>
<td>{"NOTREAD"}</td>
<td>{"NOTWRITTEN"}</td>
<td>{"NOTDELETED"}</td>
<td>{"NOTRENAMED"}</td>
</tr>
<tr>
<td>{"File not found"}</td>
<td>{"File cannot be read"}</td>
<td>{"File cannot be written"}</td>
<td>{"File cannot be deleted"}</td>
<td>{"File cannot be renamed"}</td>
</tr>
</table>
TAB;
echo $str;
?>
</body>
</html>