...

View Full Version : outputting links



axeldrummer
11-08-2007, 04:15 AM
Hey guys!

How would you have your server interpret the HTML code
<a href=dkfsjfkdsjkfd>click here</a>

When people click on this link, they are being directed to http://www.mydomain.com/dkfsjfkdsjkfd

with the http://www.mydomain.com tacked on

Not simply dkfsjfkdsjkfd

Remember that dkfsjfkdsjkfd is merely an example substitute for links people enter into a DB

This is probably a basic HTML question/problem that I've never encountered till now!

Rappa
11-08-2007, 04:53 AM
Whats your question?

Inigoesdr
11-08-2007, 04:56 AM
Use quotes, and put http:// in front of the url:

<a href="http://www.google.com">Google</a>

axeldrummer
11-08-2007, 08:29 AM
My question is this:


I allow users to submit a URL to a database... and some of them may submit it with or without the "http:// "

Thus when the url is pulled from the database, it will not include the "http://"


Do I literally have to check everything that comes in the DB, parse and modify (add http:// for example) if needed?

Or is there a simpler solution to this function?

psykx
11-08-2007, 11:45 AM
you only need

<a href="location.html" >linky</a> and this isn't php, no domain defaults to current domain and _use_ " " 's for text

aedrin
11-08-2007, 06:09 PM
Do I literally have to check everything that comes in the DB, parse and modify (add http:// for example) if needed?

Yep...

Or you could do it at display time.

EDIT: Post #1000.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum