I want to have a PHP script that has the ability to check a variable for certain values.
lets say I want to check to see if a text string contains [url-http// somewhere in the variable, how can I test for this?
I am thinking an if statement, but how can I check for the occurrence of certain parts of a variable
I’m not sure why it isn’t working for you, but it is a method I am using with success on my site. Basically, I use preg_match() to check the contents of the message that the user is trying to send to me. If they match a regular expression I have set up (I am checking for values such as "href" and "link="), I generate an error and ask the user to correct the input.
No, it won’t ultimately fix the spam problem, but it will catch the sort of spam you are getting, and should block it from coming through, at least as long as it has the "href" and other values I am checking for.