Hi
I have some js code in my .php file
In the js code I have a variable "names"
I need to tell php the value of this variable and call it $names
How can I do that?
Thank you for your help
How to equate a php variable with a javascript var
Moderator: General Moderators
- getmizanur
- Forum Commoner
- Posts: 71
- Joined: Sun Sep 06, 2009 12:28 pm
Re: How to equate a php variable with a javascript var
you can use ajax..
- flying_circus
- Forum Regular
- Posts: 732
- Joined: Wed Mar 05, 2008 10:23 pm
- Location: Sunriver, OR
Re: How to equate a php variable with a javascript var
Short answer is, you can't without making a new page request. PHP is processed before the javascript is. Therefor you cannot drink the glass of water before you pour the glass of water. Now, you can have PHP tell javascript the value of your variable.m2babaey wrote:Hi
I have some js code in my .php file
In the js code I have a variable "names"
I need to tell php the value of this variable and call it $names
How can I do that?
Thank you for your help