|
Posted by julian_m on 10/10/55 11:39
file AddHTML.htm:
----------------------------
This line is <b>ok</b><br>
This line is <b>ok</b><br>
This line is <b>ok</b><br>
<?PHP echo "This one has code prohibited "; ?>
This line is <b>ok</b><br>
This line is <b>ok</b><br>
----------------------------
file index.php
------------
<html><head .... all you know here
<?PHP
function p_function_AddOnlyHTML($AL_file)
{
$handle = fopen($AL_file, "r");
while (!feof($handle)) {
$buffer = fgets($handle, 4096);
//if (strpos($buffer, '<?') === true){
if (strpos($buffer, '<?') === true){
echo "El archivo contiene código PHP<br>";
return false;
}
echo $buffer;
}
fclose($handle);
}
p_function_AddOnlyHTML("AddHTML.htm");
?>
It actually prints
This line is ok
This line is ok
This line is ok
This line is ok
This line is ok
whereas I would expect
This line is ok
This line is ok
This line is ok
beacause, after 3rds line, function p_function_AddOnlyHTML should find
a '<?' occurrence
Any hints? I'm really lost...
regards - jm
Navigation:
[Reply to this message]
|