Jump to content

[SOLVED] Searching for a string


rpope904

Recommended Posts

I am attempting to write an ad-on for a banner exchange script, I am trying to write a mod to be run on a cron script once daily, what its going to do is connect to the exchange database, get the URLs of the members, open the site and search for our code in it.. It gets the urls, and opens them, but doesn't search for the code, or atleast say it does.. here's the code:

 

<?

echo "<b>Users found:</b><br> ";
mysql_connect("localhost", "8888888888", "8888888888888");
mysql_select_db("888888888888");
$result =  mysql_query("SELECT * FROM `ebp_ad` LIMIT 0, 30 ");
while($row = mysql_fetch_array($result)){

file_get_contents($row[url]);

if (preg_match("/^x10exchange/", '$data')) {
    echo "A match was found." .$row[url]. "<br>";
} else {
    echo "A match was not found." .$row[url]. "<br>";
} 
}
?> 

 

 

Basically, I just want it to search for x10exchange on the page, I know some of them have it.. Later on, I am going to code it to suspend the member if its not found, but this is just a test.. It returns them all as not found.. here's an example:

 

http://x10exchange.com/forums/usercheck.php

Link to comment
https://forums.phpfreaks.com/topic/105136-solved-searching-for-a-string/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.