newb Posted October 8, 2006 Share Posted October 8, 2006 how do i convert google.com or if the user inputs www.google.com to http:// or if they already have http:// it wont add the extra http:// like in vbulletin?? does anyone know how i been trying to figure it out i dont kno how to do it someone pleeze give me example pls help thanks im new at php idk where 2 start. Quote Link to comment Share on other sites More sharing options...
trq Posted October 8, 2006 Share Posted October 8, 2006 [code=php:0]if (!strstr($url,'http://')) { $url = 'http://'.$url;}[/code] Quote Link to comment Share on other sites More sharing options...
newb Posted October 8, 2006 Author Share Posted October 8, 2006 thx. i revised it a bit so it checks if the user inputs just www.google.com or google.com[code]<?phpif (!strstr($url,'http://')) { if (strstr($url,'www')) { $url = 'http://'.$url; } else { $url = 'http://www.'.$url; }}?>[/code] 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.