I have a PHP script that has to pass the value of a variable, call it $name, to a second PHP script using GET. This second PHP script calls a function in a separate .js file. That function also has to know the value of $name, because it calls a third PHP script, again using GET, and must transfer the value of $name to the third script. The third script uses $name to find the right .txt file, open it up, and send what it finds in there back to the second script.
I know how to transfer variable values between the first two PHP scripts using “?name=$name” at the end of the URL, but how do I tell the function in the .js file what the variable value is, so that it can transfer it to the third PHP script? And do I have to? Either way, how I do put the variable in at the end of the url that the javascript function uses to call the third PHP script? PHP variables must have a “$” in front of them, but javascript variables don’t. Would the javascript know what to do with “$name?”.
Before I try a dozen different things at random, I thought I’d see if anyone knows the answer.
Thanks in advance.