dongtan3395 2014-09-13 10:19
浏览 37

如何在没有提交和没有ajax的情况下将输入框值输入php变量?

I have a hidden input, as follows -

<input type='hidden' id='question_number' name='question_number' value='100'/>

I need the value of question_number into a php variable, without submitting. I know that in jquery it can be done by -

var q_no = $('#question_number').val();

but I don't know how to send it to php variable.

Also I don't want to create a new file just to get the 'question_number' by ajax. I don't know if this is possible without submitting and without ajax.

p.s. I found a related question, but I couldn't not found working answer there.

Edit-1. I know that PHP is server-side and jquery/javascript is client side, before posting this question. But, I was thinking, if a php code, can search through entire page of this particular input type, and then parse its value. I am NOT a php expert, so I can't construct this on my own. I need this value in PHP for further coding.

Edit-2. Please read Edit 1, before negative voting.

  • 写回答

2条回答 默认 最新

  • dsfasdfsda234234 2014-09-13 10:20
    关注

    That is not possible. Javascript runs on client, and PHP runs on the server.

    评论

报告相同问题?

悬赏问题

  • ¥15 关于#Java#的问题,如何解决?
  • ¥15 加热介质是液体,换热器壳侧导热系数和总的导热系数怎么算
  • ¥15 想问一下树莓派接上显示屏后出现如图所示画面,是什么问题导致的
  • ¥100 嵌入式系统基于PIC16F882和热敏电阻的数字温度计
  • ¥15 cmd cl 0x000007b
  • ¥20 BAPI_PR_CHANGE how to add account assignment information for service line
  • ¥500 火焰左右视图、视差(基于双目相机)
  • ¥100 set_link_state
  • ¥15 虚幻5 UE美术毛发渲染
  • ¥15 CVRP 图论 物流运输优化