how to access PHP variables from within JavaScript?

前端 未结 3 932
北恋
北恋 2020-12-12 06:31

I want to access PHP(server side file variables) with JavaScript(Client side script) without using MySQL. e.g. i have $name=Tom; How do i access this $name variable in Ja

3条回答
  •  有刺的猬
    2020-12-12 07:12

    Since javascript is client side and php is server side, you would need to use ajax(javascript) to access server side session variables(php). I would recommend researching jquery's ajax framework.

提交回复
热议问题