Anyway, I fixed up the code, but now there's a new problem, it seems like this little function returns true all the time, even when it really returns false. I can't figure it out and I even read the manual first this time.
function AddURL( $line )
{
if ( URLCheck( $line ) );
{
mysql_query("insert into urldatabasenew (url) values ('$line')");
}
}
function URLCheck( $line )
{
global $blackurls;
global $Blacklist;
global $badcounter;
for ($i = 0; $i < $blackurls; $i++ )
{
if( !(strpos($line,$Blacklist[$i]) === false) )
{
$badcounter++;
$shibby = number_format($badcounter);
echo "Skipped #$shibby: $line\n";
return false;
}
}
return true;
}
In the above example, even when the url is blacklisted, and even when it prints "Skipped..." to the screen, it still ads the url to the database, as if the function returned true. As far as I can tell, return does NOT exit you out of a for loop, it exits the whole function, so this doesn't make sense to me.