SitePoint Sponsor

User Tag List

Results 1 to 7 of 7
  1. #1
    SitePoint Wizard creole's Avatar
    Join Date
    Oct 2000
    Location
    Nashvegas Baby!
    Posts
    7,845
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I cannot figure it out...

    Why won't this line print right?

    echo "<li><a href=\"show_faq.php3?id=".$row["id"]." class=\"mainpage\">".$row["question"]."<br>";

    When I hover over it, it shows class= as part of the URL string. I have tried replacing double quotes with single quotes, I have even tried taking out the class="mainpage" part and it still does not print right.

    please help!
    <Edited by creole on 01-11-2001 at 07:17 PM>
    Adobe Certified Coldfusion MX 7 Developer
    Adobe Certified Advanced Coldfusion MX Developer
    My Blog (new) | My Family | My Freelance | My Recipes

  2. #2
    SitePoint Wizard
    Join Date
    Jul 1999
    Location
    Chicago
    Posts
    2,629
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Change it to this:

    echo "<li><a href=\"show_faq.php3?id=".$row["id"]."\" class=\"mainpage\">".$row["question"]."<br>";

  3. #3
    SitePoint Wizard creole's Avatar
    Join Date
    Oct 2000
    Location
    Nashvegas Baby!
    Posts
    7,845
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ok...I see it now...those sort of things just drive me up the freaking wall!

    enjoy your Karma qslack...
    Adobe Certified Coldfusion MX 7 Developer
    Adobe Certified Advanced Coldfusion MX Developer
    My Blog (new) | My Family | My Freelance | My Recipes

  4. #4
    Dumb PHP codin' cat
    Join Date
    Aug 2000
    Location
    San Diego, CA
    Posts
    5,460
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yes as qslack pointed out your rendered href tag would like

    <a href="show_faq.php3?id=23 class="mainpage"><br>;

    See the missing closing quote on your href element also you don't seem to close the <a> tag which could also cause some problems
    Please don't PM me with questions.
    Use the forums, that is what they are here for.

  5. #5
    SitePoint Wizard creole's Avatar
    Join Date
    Oct 2000
    Location
    Nashvegas Baby!
    Posts
    7,845
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    sheesh...i'm batting a thousand tonight. Changed it.

    enjoy your Karma too Freddy
    Adobe Certified Coldfusion MX 7 Developer
    Adobe Certified Advanced Coldfusion MX Developer
    My Blog (new) | My Family | My Freelance | My Recipes

  6. #6
    Non-Member
    Join Date
    Apr 2000
    Location
    Waco, Texas.
    Posts
    188
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    An alternative way, one which I find much easier when what you printing contains quotes and variables is to use
    printf()


    printf('<li><a href="show_faq.php3?id=%s" class="mainpage">%s</a><br>',$row["id"],$row["question"]);


  7. #7
    Dumb PHP codin' cat
    Join Date
    Aug 2000
    Location
    San Diego, CA
    Posts
    5,460
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    or for queries that contain single quotes '
    $result = mysql_query(sprintf("UPDATE tablename set name = '%s' WHERE id = '%s'", $name, $id))
    Please don't PM me with questions.
    Use the forums, that is what they are here for.


Bookmarks

Posting Permissions

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