The Daily Click ::. News
 

Links
News posted 28th January, 2002 by ShadowCaster  
Just a reminder to all... When posting links either on a board, in the links section or otherwise, remember to include the http:// as leaving this out will render your link useless. Most browsers will interpret "www.mysite.com" as a page within the current website, not a link to another TLD. I've already updated a couple of pages in the Links section which didnt work. It's a good idea to test the link after you have posted it. ~Mike




Posted by 29th January, 2002

This site's going down hill...
 
Posted by Andi Smith 29th January, 2002

well, the function I made would have worked if Chris had add the code which allows breaks to be used! Let's try again, eh? Function addhttp(inputString)
if inputString = "" then
exit function
end if
inputString = left(inputString,7)
inputString = left(inputString,inStrRev(inputString,""))
If inputString = "http://" then
addhttp = ""
else
addhttp = "http://"
end if
End Function
Fingers crossed.
 
Posted by Andi Smith 29th January, 2002

Yay. Now, Chris if you put addhttp(rs("url")) instead of just rs("url") it will work.

If you need any more code stuff I have a load of things I made here.
 
Posted by Rikus 29th January, 2002

Thanks Andi:-)
 
Posted by skn3 29th January, 2002

or more simply you could do

string="http://" & replace(string,"http://","")

;)
 
Posted by skn3 29th January, 2002

my mistake
string="http://" & replace(stringinput,"http://","")
 
Posted by Andi Smith 30th January, 2002

yes, but that would fix EVERY link. Which would mean the people who did put http:// would have two http://s.
ie: http://http://dc.freakware.net
 
Posted by DrJake 30th January, 2002

Well in the page 'add a link' say to put in HTTP:// before writing the address.
 
Posted by ShadowCaster 30th January, 2002

ok, I've updated the Link script to add the http:// if it doesnt exist:

if left(request.form("url"), 7) = "http://" then
   rs("url") = request.form("url")
else
   rs("url") = "http://" & request.form("url")
end if

I also found a problem, whereupon you couldnt delete a link once it had been added, which I have also fixed.

BTW, this obviously isnt going to work in the forums, etc, which is something else I mentioned in my news article.

~Mike
(Edited By ShadowCaster on 9:40:14 AM - 1/30/2002)
 
Posted by Andi Smith 30th January, 2002

man, that's a MUCH shorter way! :P

For my next trick I'm going to show you all how to make images appear on your site in just 600 lines XD
 
Posted by skn3 30th January, 2002

andi thats what the replace bit is

it adds "http://" and then replace(URL,"http://","") thus removing http:// from the original url (if its there) and putting http:// on the front by default
 
Posted by ShadowCaster 1st February, 2002

LOL Andi :D
 


 



Author Info

Advertisement

Worth A Click