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
LVL 1
burnttimeAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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

Cd&
0
burnttimeAuthor Commented:
This is the part where you tell me what script i need to use and how to use it

Thanx
0
COBOLdinosaurCommented:
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&
0
Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

Ryan ChongCommented:
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
0
Ryan ChongCommented:
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>
0
YZlatCommented:
what language are you using?
0
YZlatCommented:
Here is a javascript solution, although it would be a lot easier with asp

on page1 have something like this

<html>
<head>
<title></title>

<script language="javascript">
<!--
function passValue(myVal) {
alert(myVal)
         newForm=window.open('page2.html?val= + myVal + ');
      newForm.document.forms[0].field1.value = myVal;

         
          }

//-->
</script>
</head>
<body>



<form name="form1" method="post">
<a href="#"  target="_blank" name="linka1" onclick="passValue(this.name);">lnka1</a><br><br>
<a href="#" target="_blank" name="linka2" onclick="passValue(this.name);">lnka2</a><br><br>
<a href="#" target="_blank" name="linka3" onclick="passValue(this.name);">lnka3</a><br><br>

</form>
</body>
</html>


on page2 you'll have:

<html>
<head>
<title>untitled</title>

<script language="javascript">
<!--
function getImageName() {
      
document.forms[0].myimage.src=document.forms[0].field1.value + '.jpg';
       
      }

//-->
</script>
</head>
<body>
<form>

<input type="hidden" name="field1">
<img src="image1.jpg" name="myimage">
</form>
</body>
</html>
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Web Languages and Standards

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.