$data="Test"
$send=htmlspecialchars($data);
print($send);
?>
The above example will set $send to the value ''<a href='test'>Test</a>'' and the browser will display:
Test
(Without conversion by [[htmlspecialchars]] the browser would instead display the hyperlink __Test__)
===Read the file index.cgi line by line and format the output for display on the browser screen===
$f=fopen("/index.cgi","r"); // open the file for reading and get the file handle
if ($f) {
while (!feof($f)) {
print(htmlspecialchars(fgets($f))."\r\n"); // print the line to the screen
}
fclose($f); // close the file referenced by file handle
} else {
print("Unable to open file /index.cgi");
}
?>