Link to home
Start Free TrialLog in
Avatar of burnttime
burnttime

asked on

Select Correct Text

I have a main page called index.html

I have over 200 links on it.
Each link is name

lnka1
lnka2
lnka3
lnka4

and so on

I want it so when you click on lnka1 it goes to another page which which recieve a post or something so it loads /lnka1.txt
and /lnka1.jpg

Again for lnka2 when that is clicked load text and a picture form
/lnka2.txt
/lnka2.jpg

Basically save making 200 pages just make one
Avatar of COBOLdinosaur
COBOLdinosaur
Flag of Canada image

You need to do it server side.  Just generate the page code with a script.

Cd&
Avatar of burnttime
burnttime

ASKER

This is the part where you tell me what script i need to use and how to use it

Thanx
I haven' t got a clue.  You have not given any information.  What scripting alnguage you use depends on what you support on the server, and how you generate it depends on what the txt files look like.

And above all what we can do depends on your skill levels with the tools available.

Cd&
Avatar of Ryan Chong
or that your popup page, at least you need to have some javascript, that reads the location.href, and then using document.write method to write HTML code into that popup page accordingly, like you can write like:

<a href="page.html?image=lnka1" target="_blank">lnka1</a>

then in your page.html, try add like:

<script language="JavaScript">

var url = window.location.href;

var tmpArr = url.split("?");
var myimage = "";

if (tmpArr.length == 2) {
      var tmpArr2 = tmpArr[1].split("=");
      if (tmpArr2.length == 2) {
            myimage = tmpArr2[1];
      }
}

if (myimage != "") {
      document.write("<img src=\"images/"+myimage+"\" width=\"71\" height=\"25\">");
}

</script>

but it's a bit tracky if you want to load different contain from file according to the parameter passed in.

And since then, the Server Side Scripting Language should be the best way to handle in this situation, as what Cobol already mentioned above.

regards
oops, the link should be as like:

<a href="page.html?image=lnka1.jpg" target="_blank">lnka1</a><br>
<a href="page.html?image=lnka2.jpg" target="_blank">lnka2</a><br>
...
<a href="page.html?image=lnkaN.jpg" target="_blank">lnkaN</a><br>
what language are you using?
ASKER CERTIFIED SOLUTION
Avatar of YZlat
YZlat
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial