Passing a JavaScript Value to a PHP Variable (With Limitation)

前端 未结 3 1643
悲&欢浪女
悲&欢浪女 2020-12-17 08:15

I understand that there are existing questions and answers that have already addressed this matter. I\'ve looked through them but my situation doesn\'t allow me to apply the

3条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-17 08:41

    What I'm really trying to achieve:

    PHP variables getting JavaScript values in the same page in a Facebook iFrame. It is all right for the page to reload to pass parameter to itself.

    Easiest way: Generate a form element, populate it with some (hidden) input fields, and POST it to your server.

    AJAX is also possible, and maybe nicer for the user as it doesn’t require a reload.

    Since your’re not describing any problem in detail, I can only assume it’s mostly due to a general lack of knowledge/experience in these matters on your part. So maybe look for some tutorials first, to get a general understanding of the techniques involved.

提交回复
热议问题