/    Sign up×
Community /Pin to ProfileBookmark

change images with session

Hi, i just done with swap images in javascripts and is works great, but i’m trying to figure out how to add write that code with session veriable in php.

As you can see the code on the bottom that showing our thumbnail images and every time click on one of the thumbnail it will show bigger same images.
For sample that they are five thumbnail images of (red, yellow, blue, black flowers) and every time to click on on eof thumbnail it wills how same images but bigger images.

now my next step is that to add session variable, so let say that person click images number two, which is images of red flow, then when press key F5 or reload browser or it should show up same red flow images instead of default images.

how can i write that code with session variable in php with that!

Here is code please help me thanks.

[CODE]<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>
<html xmlns=”http://www.w3.org/1999/xhtml”>
<head>
<meta http-equiv=”Content-Type” content=”text/html; charset=utf-8″ />
<title>Untitled Document</title>
</head>

<body>
<script type=”text/javascript”><!–
function LoadGallery(image, UrlFrom){
if(typeof UrlFrom == “object” || UrlFrom == “[object]”){
document.getElementById(image).src = UrlFrom.src;
}else{
document.getElementById(image).src = UrlFrom;
};
};
//–>
</script>
…..
<div id=”littlepics”>
<div id=”bigpic”>
<img src=”jenny/one.jpg” width=”480″ height=”320″ id=”bigimage”>
<p>Step 1: Meet in person – do not rely on email or the telephone.</p>
</div>
<img src=”jenny/one.jpg” onclick=”LoadGallery(‘bigimage’,this);”>
<img src=”jenny/two.jpg” onclick=”LoadGallery(‘bigimage’,’jenny/two.jpg’);”>
<img src=”jenny/three.jpg” onclick=”LoadGallery(‘bigimage’,’jenny/three.jpg’);”>
<img src=”jenny/four.jpg” onclick=”LoadGallery(‘bigimage’,this);”>
<img src=”jenny/five.JPG” onclick=”LoadGallery(‘bigimage’,this);”>
</div>

</body>
</html>[/CODE]

to post a comment
JavaScript

0Be the first to comment 😎

×

Success!

Help @Alidad 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 5.19,
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: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

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

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...