1 line of code too

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
emelianenko
Forum Commoner
Posts: 35
Joined: Thu Sep 09, 2010 11:49 am

1 line of code too

Post by emelianenko »

Hello

as table rows dynamically generated need in my case to contain a link, they also have to pass a value to another page, but specifically inside a tab in that page.

this static link does take me to the inside of the tab, but of course it sends no value.

Code: Select all

<a href="detailpageswithlinks.htm#tabs-2" id="my-text-link">MytextLink</a>
and this is somewhat a dynamically generated link but still does not work

Code: Select all

echo "<td>" . "<a href='" . "linkTothePage" . "'>".htmlspecialchars($daten['provider']). "</a>" . "</td>";
this below takes me to the page, but not to the tab I want, only to the first one and does not pass the value, but somehow it is closer.

Code: Select all

echo "<a href=detailpages1.php?#tabs-1$row[product_id]>Product Details</a>"; 
so, somehow I need to combine those lines to make 1 line right.

I would appreciate a lot if someone knew how to write that one line.

thanks a lot
User avatar
McInfo
DevNet Resident
Posts: 1532
Joined: Wed Apr 01, 2009 1:31 pm

Re: 1 line of code too

Post by McInfo »

This URI will submit variables "a", "b", and "c" with values "1", "2", and "3", respectively, to a page named "page.php" and scroll to the first HTML element that has an id attribute with a value of "d".

Code: Select all

page.php?a=1&b=2&c=3#d
emelianenko
Forum Commoner
Posts: 35
Joined: Thu Sep 09, 2010 11:49 am

Re: 1 line of code too

Post by emelianenko »

McInfo wrote:This URI will submit variables "a", "b", and "c" with values "1", "2", and "3", respectively, to a page named "page.php" and scroll to the first HTML element that has an id attribute with a value of "d".

Code: Select all

page.php?a=1&b=2&c=3#d


Hello ! thank you again!


that was good!, so the # sign that I even had in my first line scurries down the page to find its spot, and what I was missing is the pair of variables and values. I had read about those pairs but the spot inside a tab confused me, now it is clear the concept.

and thanks again for the other line the other day, it really solved the whole page and my day, otherwise i d probably still be at it.

best regards

=====================================================================================================================
User avatar
McInfo
DevNet Resident
Posts: 1532
Joined: Wed Apr 01, 2009 1:31 pm

Re: 1 line of code too

Post by McInfo »

:)
Post Reply