468,525 Members | 2,191 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,525 developers. It's quick & easy.

redirect to receipt with variables

1
I make a payment using form. I then want(I think) to redirect to receipt with variables, tenant, rentpaid and
rentdue to show on receipt. Suggestions please. this is offline application.
Here are codes, payments.html, payments.php and rentreceipt.php:

Expand|Select|Wrap|Line Numbers
  1. <!DOCTYPE html><html lang="en">
  2.     <head>
  3.     </head>
  4.     <body bgcolor="#ccffff"><center>
  5. <font size=+2><b> record a payment</font><br>   
  6.     <form action="payment.php" method="post">
  7.         <label for="unit">Unit:</label>
  8.             <input type="text" name="unit" id="unit">
  9.         <label for="tenant">Tenant:</label>
  10.             <input type="text" name="tenant" id="tenant">
  11.         <label for="rentpaid">Amt paid:</label>
  12.             <input type="text" name="rentpaid" id="rentpaid">
  13.     <label for="hudpay">Hudpay:</label>
  14.             <input type="text" name="hudpay" id="hudpay"><br>
  15.         <label for="datepaid">Date Paid:</label>
  16.             <input type="text" name="datepaid" id="datepaid">
  17.         <label for="comments">Comments:</label>
  18.             <input type="text" name="comments" id="comments"><br>
  19.  
  20.                 <input type="submit" name="submit" value="make a payment">
  21.     </form></body></html>
  22.  
  23. <?php
  24. echo "<center>";echo date('m/d/y');echo "</center>";
  25. $id="''";
  26.  
  27. // Include config file
  28. require_once "getprerentdb.php";
  29.  
  30. //MySqli Select Query
  31. $results = $mysqli->query("SELECT * FROM paytbl");
  32.  
  33. /* --------------------------- below are posted from form ----- */
  34. $tenant=$_POST['tenant'];
  35. $unit=$_POST['unit'];
  36. $rentpaid=$_POST['rentpaid'];
  37. $hudpay=$_POST['hudpay'];
  38. $datepaid=$_POST['datepaid'];
  39. $comments=$_POST['comments'];
  40. /* --------------------------- above are posted from form ---- */
  41.  
  42. $prevbal='prevbal';
  43. $latechg='latechg';
  44. $secdep='secdep';
  45. $damage='damage';
  46. $courtcost='courtcost';
  47. $nsf='nsf';
  48. $paidsum='paidsum';
  49.  
  50. //$owe = $prevbal + $latechg + $secdep + $damage + $courtcost + $nsf;
  51. //$rentpaid=$owe; $paidsum=$owe;
  52. ?>
  53.  
  54. <!DOCTYPE html><html>
  55. <head>
  56.  
  57. <STYLE TYPE="text/css">
  58. .blue {background-color: #ccffff;}
  59. .tan {background-color: #FFD4FF;}
  60. h1.centered-cell {text-align: center;font-size: 1.1em;}
  61. </STYLE>
  62.  
  63. </head>
  64. <body><center><b><font size=+1>Rent Payment</b><p>
  65.  
  66. <?php
  67. $mysqli->query("Update paytbl SET
  68.  rentpaid = '$rentpaid', datepaid = '$datepaid', paidsum = '$paidsum', hudpay = '$hudpay', 
  69. comments = '$comments' 
  70. where unit = '$unit'");
  71. ?>
  72.  
  73. </center></body></html>
  74.  
  75. <!DOCTYPE html><html>
  76. <head>
  77.      <title>rent receipt</title>
  78. </head>
  79. <body><center>
  80. <?php
  81. echo "<center>";echo date('m/d/y');echo "<br />";
  82.  
  83. // Include config file
  84. require_once "getprerentdb.php";
  85.  
  86. //MySqli Select Query
  87. $results = $mysqli->query("SELECT * FROM numberstbl");
  88. $receiptno = "receiptno";
  89. $sql = " UPDATE numberstbl
  90.      SET $receiptno = $receiptno + 1 where id=$id  ";
  91. echo "receiptno has been updated successfully !";
  92. echo "<center>";echo "Receiptno is $receiptno";echo "<br />";
  93.  
  94. $tenant='tenant';
  95. $rentpaid='rentpaid';
  96. $rentdue='rentdue';
  97.     ?>
  98. <font size=+1> 
  99. <img src="apt-pic.jpg" alt="apartment" height=250 width=800><br>
  100.  
  101. For:<SELECT name="options">
  102. <option value="#990033" style="background-color: Violet;">Rent payment</option>
  103. <option value="#003300" style="background-color: Aquamarine;">Background Check</option>
  104. <option value="#6600cc" style="background-color: Pink;">Security Deposit Payment</option>
  105. <option value="#003300" style="background-color: Aquamarine;">Damages Payment</option>
  106. <option value="#990033" style="background-color: Violet;">Late Charges Payment</option>
  107. <option value="#003300" style="background-color: Aquamarine;">Court Costs Payment</option>
  108. <option value="#6600cc" style="background-color: Pink;">NSF Payment</option>
  109. <option value="#990033" style="background-color: Violet;"> </option>
  110. </SELECT><br>
  111. <input type="text" size = 25 STYLE="color: #000000; background-color: #D4AAFF;" name="Name" value="Business Name"> 
  112. <input type="text" size = 25 STYLE="color: #000000; background-color: #D4D4FF;" name="Addy1" value="Business address"> 
  113. <input type="text" size = 25 STYLE="color: #000000; background-color: #D4AAFF;" name="Addy2" value="City, State, Zip"> 
  114.  
  115. <TABLE BORDER="0" CELLPADDING="12" CELLSPACING="5" >
  116.    <TD>
  117. <TABLE BORDER="30" CELLPADDING="12" CELLSPACING="5">
  118. <td>
  119. <input type='text' size = 30 STYLE="color: #000000; background-color: #D4AAFF;" name="from" 
  120. value="<?php echo( htmlspecialchars($row['tenant'] ) ); ?>" /></td>
  121. <td><input type='text' size = 10 STYLE="color: #000000; background-color: D4D4FF;" name="Amount" 
  122. value="$ <?php echo( htmlspecialchars($row['Rentpaid'] ) ); ?>" /></td>
  123. <td><input type='text' size = 10 STYLE="color: #000000; background-color: D4D4FF;" name="Balance Due" 
  124. value="$ <?php echo( htmlspecialchars($row['Rentdue'] ) ); ?>" /></td>
  125. <tr>
  126. <td><input type="text" size="25" name="sign" value="Sign here" STYLE="color: 
  127. #000000; font-weight: bold; background-color: #ffccff;" onFocus="this.value=''"></td>
  128. <td colspan=2 align="center"><input type="text" size=15 name="thanks" readonly value="We Thank You:" STYLE="color: 
  129. #000000; font-weight: bold; background-color: #ffccff;" onFocus="this.value=''"></td>
  130. </tr></table>
  131.  
  132.  
  133. </b></body></html>
May 3 '21 #1
1 1382
dev7060
433 Expert 256MB
I make a payment using form. I then want(I think) to redirect to receipt with variables, tenant, rentpaid and
rentdue to show on receipt. Suggestions please.
Separate the relevant code using [code] tags. You may need to use GET/POST or session or cookie.
May 6 '21 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

4 posts views Thread by BT3 | last post: by
4 posts views Thread by Otto Haldi | last post: by
3 posts views Thread by Jessica Loriena | last post: by
1 post views Thread by hasanainf | last post: by
12 posts views Thread by gigi | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.