How to find content on a page with PHP?
Moderator: General Moderators
- JAB Creations
- DevNet Resident
- Posts: 2341
- Joined: Thu Jan 13, 2005 6:44 pm
- Location: Sarasota Florida
- Contact:
- JAB Creations
- DevNet Resident
- Posts: 2341
- Joined: Thu Jan 13, 2005 6:44 pm
- Location: Sarasota Florida
- Contact:
Ok...someone suggested this in a different forum but I get a false positive.
In this example it incorrectly echos that the string was found even though I have removed it.
test.php
Any ideas?
John
In this example it incorrectly echos that the string was found even though I have removed it.
test.php
Code: Select all
<html><head></head><body>
<?php
$fh = fopen('test.php', "rb");
$file = fread($fh, filesize('test.php'));
fclose($fh);
if(strpos($file, "<!--stuff-->")!== false)
{echo "string found";}
else
{echo "string not found";}
?></body></html>John