By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,965 Members | 1,757 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,965 IT Pros & Developers. It's quick & easy.

Assign php variable value using ajax/javascript

P: 52
Hi,
Can any one tell me how to assign a php variable value using ajax / javascript?

Regards,
Faruk Chowdhury
Nov 8 '07 #1
Share this Question
Share on Google+
3 Replies


MarkoKlacar
Expert 100+
P: 296
Hi,
Can any one tell me how to assign a php variable value using ajax / javascript?

Regards,
Faruk Chowdhury
Hi,

I don't see why your should not be able to do it just as long as you call the functions correctly.

Do you have any example code of what you are calling/assinging?

Cheers
Nov 8 '07 #2

10K+
P: 13,264
Hi,
Can any one tell me how to assign a php variable value using ajax / javascript?

Regards,
Faruk Chowdhury
The Javascript code is run on the client browser and the PHP variables are stored in memory locations on the server which Javascript cannot access. AJAX cannot only retrieve results of PHP scripts not manipulate them to change values of variables.
Nov 8 '07 #3

100+
P: 103
Use javascript to create a new cookie. Use PHP to get the contents of the cookie.

You will have to do some reloading.
Nov 8 '07 #4

Post your reply

Sign in to post your reply or Sign up for a free account.