adam119 Posted October 18, 2008 Share Posted October 18, 2008 Hi, I have a custom code into class_bbcode.php file in vbulletin forum this code will redirect every url in any thread in that forum to another website. Here is the code // --------------------- 123456 $rightlink='http://www.domainname.com?GO*'.bin2hex($rightlink); // --------------------- 123456 // standard URL hyperlink return "<a href=\"$rightlink\" target=\"_blank\">$text</a>"; In php is there any way where I can throw exceptions for some urls. For example every url in any thread will be redirected to www.domainname.com however I don't want this code to redirect this url in specific www.domain.com. Link to comment https://forums.phpfreaks.com/topic/129009-class_bbcodephp-need-help/ Share on other sites More sharing options...
corbin Posted October 18, 2008 Share Posted October 18, 2008 You could just check if the has the domain in it. if(preg_match('/^https?://(?:www\.)?domain\.com/', $something)) { //it has the url } Or you could just use strpos. Link to comment https://forums.phpfreaks.com/topic/129009-class_bbcodephp-need-help/#findComment-668832 Share on other sites More sharing options...
adam119 Posted October 19, 2008 Author Share Posted October 19, 2008 You could just check if the has the domain in it. if(preg_match('/^https?://(?:www\.)?domain\.com/', $something)) { //it has the url } Or you could just use strpos. Thank you for your replay but how is it going to look like if I added the two codes together? Link to comment https://forums.phpfreaks.com/topic/129009-class_bbcodephp-need-help/#findComment-668941 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.