The link below works fine unless the variable $row["title"]
contains a double-quotation mark ("). In that case, everything after the quotation marks is omitted in the link.
How can I make the link include everything after a double-quotation mark?
Thanks in advance,
John
echo '<td class="sitename2"><a href="http://www...com/.../comments/index.php?submission='.$row["title"].'">'.$row["countComments"].' COMMENTS</a></td>';
Always use urlencode for parts of a URL which might need to contain anything unusual....
echo '<td class="sitename2">'.
'<a href="http://www...com/.../comments/index.php?submission='.
urlencode($row["title"]).
'">'.
$row["countComments"].' COMMENTS</a></td>';
If you want to get into the standards, refer to RFC3986 which defines the safe, or 'unreserved' character as follows:
unreserved = ALPHA / DIGIT / "-" / "." / "_" / "~"
urlencode makes sure that a value you want to include in a URL obeys these standards
Make sure you urlencode your URL parameter values. see urlencode
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With