Hi,
I am new to php and I have a small problem. I have a database (mysql) driven webpage displaying events and meeting. Some of these events have websites and or pdf documents for extra information.
At the moment when I fill my webpage with all the data, I only see the flat text of the link/document:
if ($row["link"] != "")
echo "\n<tr>\n\t<td bgcolor=\"#FFFFCC\">" .
"<b>Link: </b>" .
$row["link"] .
"</td>\n</tr>";
I have tried various combinations of "<a href=\"$row["link"]"\">, but none seem to work.
I would also like to let my users upload and download pdf documents. How can I do this?
Any information would be most greatfully appreciated.
Bob. H. :oops
?>
Passing Data with URLs
Moderator: General Moderators
- twigletmac
- Her Royal Site Adminness
- Posts: 5371
- Joined: Tue Apr 23, 2002 2:21 am
- Location: Essex, UK
You don't really explain what you mean by 'none seem to work' - do you get error messages, does anything display, does the link not work when you click on it - however, try something like this:
As for uploading files have a look at:
http://www.php.net/manual/en/features.file-upload.php
To enable people to download a PDF you just have to give a link to that PDF's location.
Mac
Code: Select all
if (!empty($rowї'link'])) {
echo '<tr><td bgcolor="#FFFFCC">';
echo '<b>Link: </b>';
echo '<a href="'.$rowї'link'].'">Link Text</a>';
echo '</td></tr>';
}http://www.php.net/manual/en/features.file-upload.php
To enable people to download a PDF you just have to give a link to that PDF's location.
Mac
try something like
edit: once again: too slow 
Code: Select all
...
$query = ....
$result = mysql_query($query, $dbConn) or die(mysql_error());
while( $row = mysql_fetch_assoc($result) )
{
...
if (!empty($rowї'link']))
echo '<tr><td bgcolor="#FFFFCC"><b>Link: </b>',$rowї'link'], '</td></tr>';
...
}
...