Jump to content

charlesfw

New Members
  • Posts

    1
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

charlesfw's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. [!--quoteo(post=356209:date=Mar 18 2006, 02:29 PM:name=vic-wdd)--][div class=\'quotetop\']QUOTE(vic-wdd @ Mar 18 2006, 02:29 PM) [snapback]356209[/snapback][/div][div class=\'quotemain\'][!--quotec--] You mean using "&amp;" instead of "&"... If yes, then it is necessary, for XHTML validation. [/quote] I have a twist on this question. I have images stored in the database and to print them as a link, I must send all information relative to the <img> tag as an argument. I don't want to distract from the issue, but this is the code that prepares the link to see a full-sized image from a thumbnail: // Build full-size image link $image_link = "print_full_image.php?"; $image_link .= "id=".$id; $title = ereg_replace(" ", "%20", $title); $image_link .= "&title=".$title; $image_link .= "&seq=".$row->sequence; $caption = ereg_replace(" ", "%20", $row->caption); $image_link .= "&caption=".$caption; $image_link .= "&table=$db_table"; // Build thumbnail image request $image = "print_image.php?"; $image .= "id=".$id; $image .= "&seq=".$row->sequence; $image .= "&thumbnail=Y"; $image .= "&table=$db_table"; // Print link & image print "<td><a href=".$image_link."><img src=".$image. " alt=\"Click to see larger view\"/></a></td>"; It replace spaces with '%20' which appears to be what the browser (IE) does automatically. I don't know of any HTML or PHP method to do this automatically so I am building this string manually. The issue is that if $caption contains an ampersand, it causes the rest of the text to be truncated. So it appears that '&' is illegal in this case since it is always interpreted as a separator. Am I missing something?
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.