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

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
zmurf
Forum Newbie
Posts: 10
Joined: Wed Jan 26, 2005 8:15 am
Location: romania
Contact:

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

Post 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]
Last edited by zmurf on Wed Jan 26, 2005 10:48 am, edited 1 time in total.
snicolas
Forum Commoner
Posts: 97
Joined: Tue Nov 09, 2004 8:32 am

Post 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
User avatar
wwwapu
Forum Contributor
Posts: 197
Joined: Wed Apr 07, 2004 11:57 am
Location: Turku, Finland

Post 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.
zmurf
Forum Newbie
Posts: 10
Joined: Wed Jan 26, 2005 8:15 am
Location: romania
Contact:

10x a lot, problem solved

Post by zmurf »

yup yup yup :)

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