Skip to main content
July 19, 2006
Answered

Master Detail pages php/mysql Links

  • July 19, 2006
  • 1 reply
  • 596 views
I have a master/detail page setup that is working properly. I am trying ot add a Link to only a few of the detaill pages but not to show up on others. I tried to set just do the html in a text field but It owuld not come out as link. It did underline it like a link.
I also tried to do a If statement but am getting parse errors when I add the html code.
<? if ($row_detail['link'] {
echo "<a herf=$row_detail['link']>Expanded Detail</a>

I get a parse error of unexpected <
Any body have any idea if this is possible and how I might get it to work
Thanks
Tim
This topic has been closed for replies.
Correct answer Newsgroup_User
Tim RE wrote:
> David
> Getting closer I put in this
> <? if ($row_rscdetail['link']) {
> echo "<a herf='{$row_rscdetail['link']}'>Expanded Detail</a>"; } ?>
> Everything is good except it is not a link. It is underlined and mouses over
> but not link.

It's href, NOT herf. Since you have misspelled it every single time in
both this post and your original one, that is almost certainly the
reason it's not creating a link.

--
David Powers
Author, "Foundation PHP for Dreamweaver 8" (friends of ED)
Author, "Foundation PHP 5 for Flash" (friends of ED)
http://foundationphp.com/

1 reply

Inspiring
July 19, 2006
Tim RE wrote:
> <? if ($row_detail['link'] {
> echo "<a herf=$row_detail['link']>Expanded Detail</a>
>
> I get a parse error of unexpected <

You need to surround the PHP variable in curly braces because it
contains an associative array element:

echo "<a href='{$row_detail['link']}'>Expanded Detail</a>";

--
David Powers
Author, "Foundation PHP for Dreamweaver 8" (friends of ED)
Author, "Foundation PHP 5 for Flash" (friends of ED)
http://foundationphp.com/
Newsgroup_UserCorrect answer
Inspiring
July 20, 2006
Tim RE wrote:
> David
> Getting closer I put in this
> <? if ($row_rscdetail['link']) {
> echo "<a herf='{$row_rscdetail['link']}'>Expanded Detail</a>"; } ?>
> Everything is good except it is not a link. It is underlined and mouses over
> but not link.

It's href, NOT herf. Since you have misspelled it every single time in
both this post and your original one, that is almost certainly the
reason it's not creating a link.

--
David Powers
Author, "Foundation PHP for Dreamweaver 8" (friends of ED)
Author, "Foundation PHP 5 for Flash" (friends of ED)
http://foundationphp.com/
July 20, 2006
David
Looks like I need to get my eyes checked again.
Thank you so much . I spent too much time staring at that and just didn't catch it.
Have a good one
Tim
I'll buy your book for the help (-: