+ Reply to Thread
Results 1 to 6 of 6

Thread: Coding a HTML Link in PHP

  1. #1
    Join Date
    Sep 2005
    Location
    Houston, TX
    Posts
    2,132

    Default Coding a HTML Link in PHP

    Hi guys,
    I'm having trouble formatting a link to this line of PHP code:

    Code:
    DEFINE("LANG_FORM_RESTRICTED","Please login or register to post comments.");
    What is the correct format for making the word, "register" a link with a title tag as well?
    Steve Castaneda, Realtor
    Keller Williams Realty

    I can help you find houses for sale in Houston and also write at this blog dedicated to real estate technology for agents. I originally created this Houston Real Estate site and switched to REW - awesome decision.

  2. #2
    Join Date
    May 2007
    Location
    Houston, TX
    Posts
    70

    Default Re: Coding a HTML Link in PHP

    There may be a little more to it since my PHP is largely self-taught, but I know that putting html tags inside PHP usually requires you to put backslashes in front of all the interior quote marks. I would try it like this:

    DEFINE("LANG_FORM_RESTRICTED","Please login or <a href=\"myfile.html\">register</a> to post comments.");
    If I'm missing some information here somebody please correct me, but I know I've had to do this before and it's at least partially right, it's just been a while.
    Stacy Clifford
    ChiliPepperWeb.net
    Open-Realty Hosting

  3. #3
    Join Date
    May 2007
    Location
    Las Vegas
    Posts
    34

    Default Re: Coding a HTML Link in PHP

    Code:
    DEFINE("LANG_FORM_RESTRICTED","Please login or <a href=\"register.php\" title=\"Register Here\">register</a> to post comments.");
    Jeff
    admin@dcvegas.com
    Diversified Computation
    http://www.dcvegas.com

  4. #4
    Join Date
    May 2007
    Location
    Houston, TX
    Posts
    70

    Default Re: Coding a HTML Link in PHP

    Yeah, I didn't fill out the whole href tag, but at least I was on the right track. Use DCVegas's line Steve, it's more correct.
    Stacy Clifford
    ChiliPepperWeb.net
    Open-Realty Hosting

  5. #5
    Join Date
    Sep 2005
    Location
    Houston, TX
    Posts
    2,132

    Default Re: Coding a HTML Link in PHP

    That worked great, thanks guys!

    Just so I understand, the "\" character in PHP escapes the next character from being recognized in PHP, right? Or something like that? I know that the " character caused issues in the syntax since it is used elsewhere in this line of code.
    Steve Castaneda, Realtor
    Keller Williams Realty

    I can help you find houses for sale in Houston and also write at this blog dedicated to real estate technology for agents. I originally created this Houston Real Estate site and switched to REW - awesome decision.

  6. #6
    Join Date
    May 2007
    Location
    Las Vegas
    Posts
    34

    Default Re: Coding a HTML Link in PHP

    The backslash escapes double quotes in php - so php doesnt 'see' the double quotes, but only prints out the whole string constnat you defined.
    Jeff
    admin@dcvegas.com
    Diversified Computation
    http://www.dcvegas.com

+ Reply to Thread

Posting Permissions

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