Jump to content

Can you plz correct my href?


princeofpersia

Recommended Posts

Hi, im trying to create a link where it takes the row reference number and direct user to the revelant page, however i can get it work, this is my URL HREF

 

can u please tell me what im doing wrong? thanks

 

<td><?php echo $reference; ?><?php echo "a href='display.php?reference=".$row['reference']."'?>View Here</a>"</td>

Link to comment
https://forums.phpfreaks.com/topic/221798-can-you-plz-correct-my-href/
Share on other sites

You're missing the "<" at the start of the "<a>" tag. Also, why do you have two PHP blocks when one can do?

 

<td><?php echo $reference .  "<a href='display.php?reference=".$row['reference'] . "'" ?>View Here</a>"</td>

 

or

<td><?php echo $reference .  "<a href='display.php?reference={$row['reference']}'" ?>View Here</a>"</td>

 

 

Ken

Archived

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

×
×
  • Create New...

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.