how can i pass an internal JavaScript array result to a internal PHP script in the same PHP file?
Asked
Active
Viewed 89 times
0
-
Ajax perhaps? Have you tried to Google this? – Qirel Feb 21 '16 at 17:07
-
Or set the `stringified` values as value of hidden field and submit the form... – Rayon Feb 21 '16 at 17:07
-
4Possible duplicate of [How to pass JavaScript variables to PHP?](http://stackoverflow.com/questions/1917576/how-to-pass-javascript-variables-to-php) – docksteaderluke Feb 21 '16 at 17:09
-
Format the array as post data and load the page via ajax? – Krii Feb 21 '16 at 17:12
-
@Krii like so: http://stackoverflow.com/questions/7561569/jquery-ajax-passing-value-on-php-same-page – Vinny M Feb 21 '16 at 17:42
-
@Rayon Dabre : Thanks for the idea – Tiny Feb 22 '16 at 19:22
1 Answers
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.

Nicensin
- 943
- 1
- 6
- 15