I want to create a system on my site where my users can add there own link to a database. When I read from the database I want it to show up as a clickable link not just a site url in text.
Thanks
add link to a database and reading it as a clickable link
Moderator: General Moderators
-
llamaclock
- Forum Newbie
- Posts: 3
- Joined: Sun Mar 07, 2004 1:21 am
- Location: california
-
llamaclock
- Forum Newbie
- Posts: 3
- Joined: Sun Mar 07, 2004 1:21 am
- Location: california
- andre_c
- Forum Contributor
- Posts: 412
- Joined: Sun Feb 29, 2004 6:49 pm
- Location: Salt Lake City, Utah
Just make sure that when you display it, you wrap an anchor tag around it:
Code: Select all
<?
$query = mysql_query("select * from table_name where user='$user'") or die(mysql_error());
$row = mysql_fetch_array($query);
?>
<a href='<? echo $row['link']; ?>'><? echo $row['link']; ?></a>