princeofpersia Posted December 15, 2010 Share Posted December 15, 2010 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> Quote Link to comment Share on other sites More sharing options...
kenrbnsn Posted December 15, 2010 Share Posted December 15, 2010 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 Quote Link to comment Share on other sites More sharing options...
shlumph Posted December 15, 2010 Share Posted December 15, 2010 You have a syntax error, look at how your PHP closing tag is part of the string instead of outside. Quote Link to comment Share on other sites More sharing options...
princeofpersia Posted December 15, 2010 Author Share Posted December 15, 2010 hi thanks, but how to set the view here to be in seprate column as it looks a bit messy so closed to reference, i have tried to put it in another td but it removes the link Quote Link to comment Share on other sites More sharing options...
kenrbnsn Posted December 15, 2010 Share Posted December 15, 2010 You gave us one line of you code which we fixed. If you need more fixed, show us more code. Ken Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.