• Resolved technotron

    (@technotron)


    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! yay

    Thanks in advance

    • This topic was modified 6 years, 8 months ago by technotron. Reason: fixed it
  • The topic ‘cookies or php output data’ is closed to new replies.