Page 1 of 1

[solved] open link in same page on, lets say, layer 2

Posted: Wed Jan 26, 2005 9:18 am
by zmurf
OK, first, HELLO ! I'm very new to web and php. I've done this:
- made index.php on dreamweaver mx
- made 2 layers - layer 1 on the left ( this one has the links )
- layer 2 on the right
I'm trying to do:
- when I click on link ( wallpapers 4 ex.) i want the result to be displayed in layer 2 on the page

tried with include() but maybe I'm just slow any help is welcomed
10x a lot :)[/i]

Posted: Wed Jan 26, 2005 9:56 am
by snicolas
You cannot really "target" a link to a layer..
Your solution will be

Layer 1 where your link is
Layer 2 where the second layer is (empty)
Layer 3 , invisible that will have the same coordinate of layer 2 and when clicking on the link in layer 1 , it will display layer 3 in its position.

s

Posted: Wed Jan 26, 2005 10:02 am
by wwwapu
I don't know anything about dreamweaver, but this might help.
Let's say we are using two <div> elements, the needed data could be read from $_GET. Positioning with CSS.

Code: Select all

something.php
<?php
$possible_show=array&#123;" ", "s1.txt", "s2.txt" and so on&#125;;
if(!empty($_GET&#1111;"show"]))&#123;
    $show_this=$possible_show&#1111;$_GET&#1111;"show"]];
&#125; else $show_this="default.txt";
?>
...
<div id="links">
<a href="something.php?show=1">Some1</a>
<a href="something.php?show=2">Some2</a>
...
<div>

<div id="show">
<?php include($show_this); ?>
</div>
Or something like that. The point is to read the value from $_GET array and then fetch the matching include. Note the arrays start from 0, which would be treated as empty.

10x a lot, problem solved

Posted: Wed Jan 26, 2005 10:46 am
by zmurf
yup yup yup :)

10x a lot 4 the answers, i implemented the one with the code help and it works just fine