2016-12-30 18:43


  • php
  • html
  • javascript

I am attempting to pass the parameters of the current html page to the php page using a form. So far I have the following function inside my header in the html

    function getURLParameter(name) {
  return decodeURIComponent((new RegExp('[?|&]' + name + '=' + '([^&;]+?)(&|#|;|$)').exec( || [null, ''])[1].replace(/\+/g, '%20')) || null;


and then in the form I have the following

<input type="hidden" name="amtpaid" id="amtpaid" value="getURLParameter('amt')" />
        <input type="hidden" name="status" id="sts" value="getURLParameter('st')" />

this is assuming a url such like

however all that the php says is posted is the following (this is aa dump of all post data)

Array ( [on1] => Steam 32 - ID (STEAM_0:X:XXXX) [os1] => hj [amtpaid] => getURLParameter('amt'); [status] => getURLParameter('st'); )


  • 点赞
  • 回答
  • 收藏
  • 复制链接分享