Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    New Coder
    Join Date
    Jun 2004
    Location
    Los Angeles, CA
    Posts
    92
    Thanks
    0
    Thanked 0 Times in 0 Posts

    outputting links

    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!

  • #2
    Regular Coder Rappa's Avatar
    Join Date
    Nov 2005
    Location
    LI
    Posts
    356
    Thanks
    21
    Thanked 9 Times in 9 Posts
    Whats your question?

  • #3
    Super Moderator Inigoesdr's Avatar
    Join Date
    Mar 2007
    Location
    Florida, USA
    Posts
    3,647
    Thanks
    2
    Thanked 406 Times in 398 Posts
    Use quotes, and put http:// in front of the url:
    Code:
    <a href="http://www.google.com">Google</a>

  • #4
    New Coder
    Join Date
    Jun 2004
    Location
    Los Angeles, CA
    Posts
    92
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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?

  • #5
    New Coder
    Join Date
    Apr 2007
    Posts
    89
    Thanks
    1
    Thanked 2 Times in 2 Posts
    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

  • #6
    Senior Coder
    Join Date
    Jan 2007
    Posts
    1,648
    Thanks
    1
    Thanked 58 Times in 54 Posts
    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.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •