hello,
how would i go about adding a string to an entry, only if it doesn't exist already.
on entering a URL in a member field, i have found most people prefer to omit http://
which just comes up as http://www.mydomain.com/www.theirdomain.com and returning a 404.
how i do i go about automatically adding the http:// if they don't... and only if they don't?
[SOLVED] appending characters
Moderator: General Moderators
[SOLVED] appending characters
Last edited by $var on Thu Oct 27, 2005 2:27 pm, edited 1 time in total.
- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
prepending http:// can be done via simply looking at the output of strpos() to make sure http:// is the first part of the string. If it fails or is later in the string
Code: Select all
$url = 'http://' . $url;