how do i pass info from javascript to php

how do i pass info from javascript to php
i have a var in javascript that i want to pass to a var in php
mgtm3Asked:
Who is Participating?
 
brad2575Connect With a Mentor Commented:
You can not to that unless you submit a form or use a querystring variable.

PHP is a serverside script and is only run WHEN the page loads.  javascript is client side and runs on the users machine AFTER the page loads.
0
 
b0lsc0ttConnect With a Mentor IT ManagerCommented:
mgtm3,

A cookie can be another way but the common and easy ways were mentioned above.

Let me know if you have any questions or need more information.

b0lsc0tt
0
 
b0lsc0ttIT ManagerCommented:
I'm glad I could help.  Thanks for the grade, the points and the fun question.

bol
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.