Web Analytics Made Easy -
StatCounter Pass a Variable for a Hidden Field in a Form - CodingForum


No announcement yet.

Pass a Variable for a Hidden Field in a Form

  • Filter
  • Time
  • Show
Clear All
new posts

  • Pass a Variable for a Hidden Field in a Form

    In a form I'm passing multiple hidden fields, but one hidden field, "startdate" does not have a constant value. It should be the current date. How should I pass this information to the linkpointcentral program below? The PHP code I thought would work is not working. The hidden field of "startdate" is not getting passed to the next screen. Please help... see the code below.



    <form method=post action="https://www.linkpointcentral.com/lpc/servlet/lppay">

    $today = date("Ymd")\n
    echo "<input type=hidden name='startdate' value='$today'>\n"

    <input type=hidden name="mode" value="payplus">
    <input type=hidden name="storename" value="664104">
    <input type=hidden name="submode" value="periodic">
    <input type=hidden name="periodicity" value="m1">

    <input type=hidden name="installments" value="60">
    <input type=hidden name="threshold" value="2">
    <input type="hidden" name="Domain" value="caterers">

  • #2

    Does php actually writes your intended date in

    <input type=hidden name='startdate' value='$today'> ?

    If not, change the name 'startdate' and try again.

    If not, use JavaScript to define date as soon as the users click submit button.


    • #3
      the whole "startdate" hidden field line is not being included in the linkpointcentral parameters, as is the other hidden fields. Is this the correct approach for passing a hidden field through HTML using PHP? It doesn't appear to be.