cookies or php output data
-
Hi,
Great plugin, I can read cookies and undertake SQL querys on DB so this is great. I want to pass some PHP data back to the Java script. I tried setcookies(….) but no cookies are set so can’t transfer that way. I tried echo “<script>$value</script>” and nothing appears. The snippet is in the body of the wordpress page.
I also tried
echo ‘<script>’;
echo ‘var name = ‘ . json_encode($value) . ‘;’;
echo ‘</script>’;
and it worked! yayThanks in advance
- The topic ‘cookies or php output data’ is closed to new replies.