Jump to content

set a PHP variable with JavaScript


Craig Hopson
 Share

Recommended Posts

hi guys i have this line off code witch slideshows photos i want to set the current photo file name to be set as a PHP variable

bglayer.stop(true,true).css({opacity:1, zIndex:999}).empty().append($('<img src="'+imagesarr[i].src+'" />').css(this.scaleimage(imagesarr[i])))

Like this maybe

bglayer.stop(true,true).css({opacity:1, zIndex:999}).empty().append($('<img src="'+imagesarr[i].src+'" /><? $FileName ='+imagesarr[i].src+';?>').css(this.scaleimage(imagesarr[i])))

I REALLY DONT UNDERSTAND JAVASCRIPT AT ALL please help

Edited by Craig Hopson
Link to comment
Share on other sites

The only way I know to set a php variable with javascript is with an ajax call.

Link to comment
Share on other sites

For the image src, point it to a PHP script where you pass the filename in the querystring. PHP can get the filename, transform the image, and output the proper headers and image data so that the browser displays it. You can also include in the querystring things like which direction to rotate it, how far, a different transformation to use, etc.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...