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... Link to comment https://forums.phpfreaks.com/topic/123084-if-form-field-contains/ 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. Link to comment https://forums.phpfreaks.com/topic/123084-if-form-field-contains/#findComment-635639 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) Link to comment https://forums.phpfreaks.com/topic/123084-if-form-field-contains/#findComment-635896 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 Link to comment https://forums.phpfreaks.com/topic/123084-if-form-field-contains/#findComment-636856 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.