Yes, if you include the
section in your PHP code, you can do something similar to the following:
In your case, you would be looking into the following code structure:
The reason why this is possible is because although the Javascript is run on the client-side, it's processed on the server-side first prior to being presented on the page. Thus, it'll replace all necessary instances of $cid
with the one you have included.
Enjoy and good luck!
EDIT: