/    Sign up×
Community /Pin to ProfileBookmark

[RESOLVED] setting a variable on a mouse click

I would like to set the variable for “room” when someone clicks on a link so that the area of the map is highlighted.

This is what i have.

[code=php]<p><a href=”http://map.com/19.php?<?=$setting?>$room=copiers”>Copiers</a></p>
<?php
//Copiers
if ($room==”copiers”)
{ echo ‘<div style=”width: 54px; height: 38px; position: absolute; left: 507px; top: 188px; background-color: #ffff00; opacity:0.2;filter:alpha(opacity=20)”></div>’; }
if ($room==”copiers”)
{ echo ‘<div style=”width: 49px; height: 48px; position: absolute; left: 158px; top: 208px; background-color: #ffff00; opacity:0.2;filter:alpha(opacity=20)”></div>’; }
?>
[/code]

to post a comment
PHP

3 Comments(s)

Copy linkTweet thisAlerts:
@ilbonparaurtiMay 18.2010 — Look at JavaScript - particularly image maps.
Copy linkTweet thisAlerts:
@beylahauthorMay 18.2010 — I have being playing more and i feel i am on the right track but it is still not working

[code=php]<p><a href="http://map.com/19.php?link=copiers">Copiers</a></p>
<?php
$link = $_GET['link'];
//Copiers
if ($link=="copiers")
{ echo '<div style="width: 54px; height: 38px; position: absolute; left: 507px; top: 188px; background-color: #ffff00; opacity:0.2;filter:alpha(opacity=20)"></div>'; }
if ($link=="copiers")
{ echo '<div style="width: 49px; height: 48px; position: absolute; left: 158px; top: 208px; background-color: #ffff00; opacity:0.2;filter:alpha(opacity=20)"></div>'; }
?>
[/code]
Copy linkTweet thisAlerts:
@beylahauthorMar 18.2011 — [code=php]$sql="SELECT * FROM directory_extras WHERE name='Copiers18'";
$result=mysql_query($sql);
while($rows=mysql_fetch_array($result)){
echo '<p class="links"><a href="'.$rows['floor'].'.php?id='.$rows['id'].'">Copiers, Shredders<br />Typewriters</a><br /><br />';
}
//Copiers
if ($name=="Copiers18")
{ echo '<div style="width: 65px; height: 55px; position: absolute; left: 496px; top: 667px; background-color: #ffff00; opacity:0.5;filter:alpha(opacity=50)"></div>'; }
if ($name=="Copiers18")
{ echo '<div style="width: 64px; height: 41px; position: absolute; left: 444px; top: 98px; background-color: #ffff00; opacity:0.5;filter:alpha(opacity=50)"></div>'; }
[/code]
×

Success!

Help @beylah spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.17,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...