Jump to content

Archived

This topic is now archived and is closed to further replies.

dickd

URL hyperlink

Recommended Posts

Hi I am new to SQL and have tried searching for a answer with no joy, I have a data base that stores members details including URL to there web site.

In the query i have that displays the user details i can not see how to make the url field a click on hyperlink.

I use Dreamweaver 8 for php
Can any one help me or piont me i the right direction, should i be storing them in my database differently (Varchar) or do i do something with my php page

Cheers
Dickd

Share this post


Link to post
Share on other sites
Pretty easy, just echo the db field for the url into a html hyperlink.

[code]
<?php
echo <a href="'.$row['userurl'].'">$row['userurl']</a>;
?>
[/code]

Something like that? Of course you will need to adapt it to your code.

Share this post


Link to post
Share on other sites
[!--quoteo(post=358754:date=Mar 26 2006, 10:22 PM:name=maexus)--][div class=\'quotetop\']QUOTE(maexus @ Mar 26 2006, 10:22 PM) [snapback]358754[/snapback][/div][div class=\'quotemain\'][!--quotec--]
Pretty easy, just echo the db field for the url into a html hyperlink.

[code]
<?php
echo <a href="'.$row['userurl'].'">$row['userurl']</a>;
?>
[/code]

Something like that? Of course you will need to adapt it to your code.
[/quote]


Hi my line of code read
<td><span class="style12"><?php echo $row_Recordset1['Web_site']; ?></span></td>

changed to
<td><span class="style12"><?php echo <a href="'$row_Recordset1['Web_site']'">$row_Recordset1['Web_site']</a>; ?></span></td>


I have tried a few combinatins of above but just get a line error i must have missed a quote somewhere
as it says
Parse error: parse error, unexpected '<', expecting ',' or ';' in /home/httpd/vhosts/......../memberdetails.php on line 148

Share this post


Link to post
Share on other sites
Guest footballkid4
Simple quotes were left out
Replace this:
[code]<?php echo <a href="'$row_Recordset1['Web_site']'">$row_Recordset1['Web_site']</a>; ?>[/code]
With this:
[code]<?php echo '<a href="'.$row_Recordset1['Web_site'].'">'.$row_Recordset1['Web_site'].'</a>'; ?>[/code]

Share this post


Link to post
Share on other sites
Cheers, now understand the order of the quotes etc many thanks

Share this post


Link to post
Share on other sites

×

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.