0

how can i pass an internal JavaScript array result to a internal PHP script in the same PHP file?

6
  • Ajax perhaps? Have you tried to Google this? Commented Feb 21, 2016 at 17:07
  • Or set the stringified values as value of hidden field and submit the form... Commented Feb 21, 2016 at 17:07
  • 4
    Possible duplicate of How to pass JavaScript variables to PHP? Commented Feb 21, 2016 at 17:09
  • Format the array as post data and load the page via ajax? Commented Feb 21, 2016 at 17:12
  • @Krii like so: stackoverflow.com/questions/7561569/… Commented Feb 21, 2016 at 17:42

1 Answer 1

1

PHP is executed before Javascript can be executed. PHP is server-side and Javascript client-side. (In normal case; disregarded node.js ...) You could use some GET or POST to reach what you want.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.