<!DOCTYPE html>
<html>
<head>
  <title>Credit Card Details</title>
</head>
<body>
  <form name="form1" method="POST" action="cardvalidate.php" autocomplete="off">

  <?php
    foreach ($_POST as $key => $value) {
        $value = trim(stripslashes($value));
        $safeValue = htmlspecialchars($value, ENT_QUOTES, 'UTF-8');
        echo "<input type='hidden' name='" . htmlspecialchars($key, ENT_QUOTES, 'UTF-8') . "' value='$safeValue'>";

        // If you need to use these values in PHP logic:
        $$key = $value;
    }
  ?>

  <table width="98%" class="tablebdr" cellspacing="0" cellpadding="0">
    <tr align="center">
      <td colspan="3" class="tdhead">Credit Card Details</td>
    </tr>

    <tr><td colspan="3" align="center">&nbsp;</td></tr>

    <tr>
      <td align="right">Credit Card No</td>
      <td></td>
      <td align="left">
        <input name="creditcardno" type="text" id="creditcardno" value="" size="30" autocomplete="off">
      </td>
    </tr>

    <tr><td colspan="3">&nbsp;</td></tr>

    <tr>
      <td align="right">Expiry Date</td>
      <td></td>
      <td align="left">
        <input name="expirydate" type="text" id="expirydate" value="" size="30" placeholder="MM/YY" autocomplete="off">
      </td>
    </tr>

    <tr><td colspan="3">&nbsp;</td></tr>

    <tr>
      <td align="right">Amount</td>
      <td></td>
      <td align="left"><b>&nbsp;$<?= htmlspecialchars($amount ?? '0.00') ?></b></td>
    </tr>

    <tr><td colspan="3">&nbsp;</td></tr>

    <tr align="center">
      <td colspan="3">
        <input type="submit" name="Submit" value="Transfer Amount">
      </td>
    </tr>
  </table>

  </form>
</body>
</html>
