How do I use PHP to supply info to JavaScript?

ZommokAgreego

New Member
I have a simple image-looping script that changes the \[code\]src\[/code\] of an image.\[code\]function cycleNext(){ ++imgIndex; if(imgIndex>imgCount) { imgIndex = 1; } setImgSrc(imgIndex);}\[/code\]However, at present, I'm (shudder) manually entering \[code\]imgCount\[/code\] in my script. The alternative is server-side, but I don't know how to fetch this information. I imagine it's pretty simple, though.How can I use PHP to supply this script with the number of images in the folder?
 
Back
Top