Reputation: 396
I am trying to display a URL stored in mysql as a link in php table like this
echo "<td><a href=".$row['resume'].">Resume</a></td>";
where $row['resume'] retrieves correct data using mysql_fetch_array
However the whitespace between file link gets truncated automatically
for example my file name is "this is a resume.doc" i only get "this" in link
help.
Upvotes: 2
Views: 139
Reputation: 944451
You need to do several things:
Such:
$url = htmlspecialchars( urlencode( $row['resume'] ) );
echo "<td><a href='$url'>Resume</a></td>";
Upvotes: 4
Reputation: 6758
You need to place quotes around your href attribute.
echo "<td><a href=\"".$row['resume']."\">Resume</a></td>";
Upvotes: 6