views:

25

answers:

1

Hi to all,

i would like make a simple script that store one dynamic image (Random) in a variable and then show that in another page (Like before).

This is the source code that show the image in the 1st page (Where i need to store):

<img alt="CaptchaA" style="display:block;" src="image_gen.php?rnd=8900yh0484" id="captchaB" name="captchaB" />

Is possible to make that script/function?

Thanks in advance.

Kind regards.

Luca

+1  A: 

Each page is a fresh restart of any JavaScript that runs in it, so any data you have would need to be stored externally.

If you want to pass directly from one page to the next, then encoding the value in the URL would probably be the easiest method.

Otherwise you are looking at cookies (well supported but small) or things like HTML 5 Offline Storage. These, however, risk introducing race conditions (should the user be viewing the site in more then a single tab at a given moment).

David Dorward
Ok thanks you :)
Luca