Forum Moderators: mack
Say I have 4 hyperlinks with names
1. New York
2. London
3. Paris
4. Moscow
When the user clicks on New york in the hyperlink URL (given below) DYNAMIC KW should be replaced with "New York". Sameway when London is clicked DYNAMIC KW should be replaced with "London"....and so on
Hyperlink Url:
[xyz.com...] KW&mode=abc
Where can I find a code or script readily available to do this?
This could be silly to experienced people. Sorry PLs help. Thankyou.
<a href="external-search?search-type=ss&tag=affid&keyword=New%20York&mode=abc">New York</a>
<a href="external-search?search-type=ss&tag=affid&keyword=London&mode=abc">London</a>
<a href="external-search?search-type=ss&tag=affid&keyword=Paris&mode=abc">Paris</a>
<a href="external-search?search-type=ss&tag=affid&keyword=Moscow&mode=abc">Moscow</a>
I think it's the easiest way.
Michal Cibor
PS. If that's not what you want, eg you need it put dynamically write with what language, eg PHP.
<?PHP
$list = "New York; London; Paris; Moscow";
$list_array = explode("; ", $list);
$length = count($list_array);
?>
then in html print:
<?PHP
for($i = 0; $i < $length; $i++)
{
print("<a href=\"bla.bla.com/external-search?search-type=ss&tag=affid&keyword=".$list_array[$i]." &mode=abc\">".$list_array[$i]."</a><br>");}
?>
Seems to be working for me.
To add new elements just put them in a variable $list, separated by "; " (don't forget about space).
To do it in javascript you can ask the same question on javascript forum, because I'm not so very good at it. (I don't know how to easily make an array)
Hope it clears things a little. If not, don't hesitate to write, just specify what do you want.
Best regards
Michal Cibor
The code works perfectly and I wanted exactly this kind of a thing.
But there is one small problems. The link
[xyz.com...] KW&mode=abc
turns to
[mysite.com...] KW&mode=abc
and shows a page not displayed error. Thank you.
-alex.