redirect to the receipt file

1Tsme1941

Member
Hi, a little prob with code. I have a payment program and want to follow with the receipt. The following
code is the receipt.
1) I've tried to redirect to the receipt file after payment. I have yet to achieve that.
2) I want the receipt# on the receipt. I swear, I'm trying
3) I need to send 3 variables to the receipt program, you're probably laughing thinking how simple this is
I've poured thru the manuals & forums and the discussions are far past my little efforts. Pointers, anything?
---------------------------------
the code:
<?php
echo "<center>";echo date('m/d/y');echo "<br />";

// Include config file
require_once "getprerentdb.php";

//MySqli Select Query
$results = $mysqli->query("SELECT * FROM numberstbl");
$receiptno = "receiptno";
$sql = " UPDATE numberstbl
SET $receiptno = $receiptno + 1 where id=$id ";
echo "receiptno has been updated successfully !";
echo "<center>";echo "Receiptno is $receiptno";echo "<br />"; // doesn't work

$tenant=$_POST['tenant'];
$rentpaid=$_POST['rentpaid'];
$rentdue=$_POST['rentdue'];
?>
<!DOCTYPE html><html>
<head>
<title>rent receipt</title>
</head>
<body><center><font size=+1>
<img src="apt-pic.jpg" alt="apartment" height=250 width=800><br>

For:<SELECT name="options">
<option value="#990033" style="background-color: Violet;">Rent payment</option>
<option value="#003300" style="background-color: Aquamarine;">Background Check</option>
<option value="#6600cc" style="background-color: Pink;">Security Deposit Payment</option>
<option value="#003300" style="background-color: Aquamarine;">Damages Payment</option>
<option value="#990033" style="background-color: Violet;">Late Charges Payment</option>
<option value="#003300" style="background-color: Aquamarine;">Court Costs Payment</option>
<option value="#6600cc" style="background-color: Pink;">NSF Payment</option>
<option value="#990033" style="background-color: Violet;"> </option>
</SELECT><br>
<input type="text" size = 25 STYLE="color: #000000; background-color: #D4AAFF;" name="Name" value="Business Name">
<input type="text" size = 25 STYLE="color: #000000; background-color: #D4D4FF;" name="Addy1" value="Business address">
<input type="text" size = 25 STYLE="color: #000000; background-color: #D4AAFF;" name="Addy2" value="City, State, Zip">

<TABLE BORDER="0" CELLPADDING="12" CELLSPACING="5" >
<TD>
<TABLE BORDER="30" CELLPADDING="12" CELLSPACING="5">
<td>
<input type='text' size = 30 STYLE="color: #000000; background-color: #D4AAFF;" name="from"
value="<?php echo( htmlspecialchars($row['tenant'] ) ); ?>" /></td>
<td><input type='text' size = 10 STYLE="color: #000000; background-color: D4D4FF;" name="amt"
value="$ <?php echo( htmlspecialchars($row['rentpaid'] ) ); ?>" /></td>
<td><input type='text' size = 10 STYLE="color: #000000; background-color: D4D4FF;" name="due"
value="$ <?php echo( htmlspecialchars($row['rentdue'] ) ); ?>" /></td>
<tr>
<td><input type="text" size="25" name="sign" value="Sign here" STYLE="color:
#000000; font-weight: bold; background-color: #ffccff;" onFocus="this.value=''"></td>
<td colspan=2 align="center"><input type="text" size=15 name="thanks" readonly value="We Thank You:" STYLE="color:
#000000; font-weight: bold; background-color: #ffccff;" onFocus="this.value=''"></td>
</tr></table>

</b></body></html>
---------------------------------------
05/02/21
receiptno has been updated successfully !
Receiptno is receiptno
------------------------------------------
the payment (from a form) code:
<?php
echo "<center>";echo date('m/d/y');echo "</center>";
$id="''";

// Include config file
require_once "getprerentdb.php";

//MySqli Select Query
$results = $mysqli->query("SELECT * FROM paytbl");

$tenant=$_POST['tenant'];
$unit=$_POST['unit'];
$rentpaid=$_POST['rentpaid'];
$hudpay=$_POST['hudpay'];
$datepaid=$_POST['datepaid'];
$comments=$_POST['comments'];

$tenant='tenant';
$unit='unit';
$rentpaid='rentpaid';
$hudpay='hudpay';
$prevbal='prevbal';
$latechg='latechg';
$secdep='secdep';
$damage='damage';
$courtcost='courtcost';
$nsf='nsf';
$paidsum='paidsum';
$datepaid='datepaid';
$late='late';
$comments='comments';

$owe = $prevbal + $latechg + $secdep + $damage + $courtcost + $nsf;
$rentpaid=$owe; $paidsum=$owe;
?>

<!DOCTYPE html><html>
<head>

<STYLE TYPE="text/css">
.blue {background-color: #ccffff;}
.tan {background-color: #FFD4FF;}
h1.centered-cell {text-align: center;font-size: 1.1em;}
</STYLE>

</head>
<body><center><b><font size=+1>Rent Payment</b><p>

<?php
// ---------------------------------------
while($row = mysqli_fetch_array($results)) {
// ----------------------------------------
if(!empty($_POST["update"]))
{
$mysqli->query("Update paytbl SET
rentpaid = '$rentpaid', datepaid = '$datepaid', paidsum = '$paidsum', hudpay = '$hudpay',
comments = '$comments'
where unit = '$unit'");
}
}
?>

</center></body></html>
 
Top