Jump to content


Photo

URL hyperlink


  • Please log in to reply
4 replies to this topic

#1 dickd

dickd
  • New Members
  • Pip
  • Newbie
  • 3 posts

Posted 27 March 2006 - 02:25 AM

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

#2 maexus

maexus
  • Members
  • PipPipPip
  • Advanced Member
  • 191 posts

Posted 27 March 2006 - 03:22 AM

Pretty easy, just echo the db field for the url into a html hyperlink.

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

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

#3 dickd

dickd
  • New Members
  • Pip
  • Newbie
  • 3 posts

Posted 27 March 2006 - 05:55 AM

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

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

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


#4 Guest_footballkid4_*

Guest_footballkid4_*
  • Guests

Posted 27 March 2006 - 06:11 AM

Simple quotes were left out
Replace this:
<?php echo <a href="'$row_Recordset1['Web_site']'">$row_Recordset1['Web_site']</a>; ?>
With this:
<?php echo '<a href="'.$row_Recordset1['Web_site'].'">'.$row_Recordset1['Web_site'].'</a>'; ?>


#5 dickd

dickd
  • New Members
  • Pip
  • Newbie
  • 3 posts

Posted 27 March 2006 - 06:28 AM

Cheers, now understand the order of the quotes etc many thanks




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users