Hello everyone.
Does anybody knows how I can assign a php variable with a value returned by a javascript function?
Thanks
Daysen
Few ways:
if you're posting a form: <input type="hidden" name="jsVar" value=""> In JavaScript: document.jsVar.value = "new value";
if it's a link you're calling, use onClick="window.location=loc; return false;" Your JavaScript function will have to assign loc to hold the value: "script.php?jsVar=new+value" - watch for special chars as space, plus,...
I'm not sure if this can be used, but JavaScript can work with cookies. You can try to set a cookie and read it from PHP script.