External link staying within website

doctorow100

New Member
If I have a link that is eg.: www.google.com, the link goes to mydomain.com/www.google.com.If the http:// is at the beginning, the link goes to www.google.com.Is there a way to ensure that the link does go to the external site, using php etc?This link goes to mydomain.com/www.google.com:\[code\]<a href="http://stackoverflow.com/questions/14515458/www.google.com">Link</a>\[/code\]This link goes to www.google.com (as I want for all):\[code\]<a href="http://www.google.com">Link</a>\[/code\]Ended up using this to verify:\[code\]if(strpos($URL, "http://") !== false) $URL = $URL;else if (strpos($URL, "https://") !== false) $URL = $URL;else $URL = "http://$URL";\[/code\]
 
Back
Top