I wouldn’t even call myself a beginner with php but I do understand most other programming languages. I see that the JavaScript code will allow me to call the PHP function (I took out the contents of the function to save space), and the PHP function will properly pass a value back to JavaScript.
The question is how to pass the value (a random number) contained within the JavaScript variable ‘currentAd2’ to the PHP variable ‘$currentAd2’ within the function?
PHP Function:
function bannerurl($currentAd2) {
}
JavaScript Code:
var currentAd2 = Math.round(Math.random() * imgCt1 )
var banner2 = document.getElementById(‘adBanner2’);
banner2.src=<?php bannerurl([b]currentAd2[/b]); ?>
This example simply passes the string “currentAd2” into the PHP function. Can PHP read the value of a hidden html input field?
Much Regards!