BigTime Posted September 7, 2008 Share Posted September 7, 2008 Hi everyone... What is the proper syntax to identify if a form field contains a certain character string using a wildcard? Is this possible? Im essentially trying to throw an error if an entry field contains http:// if ($_POST[map] like 'http:%'){ except I get Parse error: syntax error, unexpected T_STRING on that line when I try it... Quote Link to comment Share on other sites More sharing options...
BigTime Posted September 7, 2008 Author Share Posted September 7, 2008 mmmmm thinking I should have posted this in PHP forums.... please move it there if it belongs there...I dont want to double post over there and anger the gods. Quote Link to comment Share on other sites More sharing options...
Ken2k7 Posted September 7, 2008 Share Posted September 7, 2008 Is map a constant? If not, then it has to be in string format. if (strpos($_POST["map"], "http://") !== false) Quote Link to comment Share on other sites More sharing options...
BigTime Posted September 8, 2008 Author Share Posted September 8, 2008 thanks for your time, Ken Ill try it out Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.