RickyF Posted July 14, 2007 Share Posted July 14, 2007 Hey, How can i make it so that only if .jpg etc is stopped, as the word jpg etc is being stopped, i tried adding dots before each word in the array, but this made no difference. Thanks if (eregi("jpg|jpeg|gif|bmp|png", $weburl)) { die ("Your website url can not be an image."); } Link to comment https://forums.phpfreaks.com/topic/59942-solved-stopping-specific-strings-jpg-etc/ Share on other sites More sharing options...
lur Posted July 14, 2007 Share Posted July 14, 2007 if (preg_match('/\.(jpg|jpeg|gif|bmp|png)$/', $weburl)) However, this is quite pointless since any type of content can be delivered using any "file extension". Link to comment https://forums.phpfreaks.com/topic/59942-solved-stopping-specific-strings-jpg-etc/#findComment-298097 Share on other sites More sharing options...
RickyF Posted July 14, 2007 Author Share Posted July 14, 2007 Hello, The script is actually a plug board im developing, the point of the partiular validation is to stop people from posting the link to their banner in the website url input field, as some people seem to get confused and try putting the image into the web address and vice versa. Thanks for the help. Link to comment https://forums.phpfreaks.com/topic/59942-solved-stopping-specific-strings-jpg-etc/#findComment-298099 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.