Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Hi, Could you please make workable my PHP code so it can 1. possibility insert a

ID: 639976 • Letter: H

Question

Hi,

Could you please make workable my PHP code so it can

1. possibility insert amount Due for each course

2. Get Total Due

3. Rest of input text

Thank you.

See code below

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Payment</title>
</head>
<body>



<h1>Course Payment</h1>

<?PHP
$stuinfo = $_GET['param1'];   
$arrStuInfo = explode('||', $stuinfo);
$stuname = $arrStuInfo[0];
$totcost = $arrStuInfo[1];
$totpaid = $arrStuInfo[2];
$totowed = $totcost - $totpaid;
$courses = $_GET['param2'];
$financial = $_GET['param3'];
?>
<h4>Student Name: <?PHP echo $stuname; ?>Antonina Murzina</h4>
<h4>Course Selected</h4>
  
  
<table border="1">
<tr>
<th>CourseTitle</th>
<th>Amount Due</th>
</tr>
<tr>
<td>CIS 2454</td>
<td>$300</td>
</tr>
<tr>
<td>ENG 1500</td>
<td>$260</td>
</tr>
<tr>
<td>Total Due</td>
<td>$360</td>
</tr>
</table> <br />
<label for="amt">Student ID:
<input type="text" name="payAmt" size="10"/>
<br />
Amount paid:
<input type="text" name="payAmt2" size="12"/>
<br />
Credit Card Number:
<input type="text" name="payAmt3" size="18"/>
<br />
<br />
<br />
<br />
<input type="submit" value="Submit" />
<br />
</label>
<hr></hr>
<h1>Payment Result: <?PHP echo $totcost; ?></h1>
<h3>Thank you for your payment!</h3>
<br />
<p>Payment amount: 560 <?PHP echo $totpaid; ?></p>
<p>Student ID: 3456570
<?PHP echo $totpaid; ?>
</p>
<br />

</body>
</html>

Explanation / Answer

why you are using songle web page to calculating and showing results....use two pages for collecting and informatin and outputting answer....in your example variables printing syantax is problem i think any how...by using this example you can develop same application with damn easy

<html>
<body>

<form action="welcome.php" method="post">
Name: <input type="text" name="name"><br>
E-mail: <input type="text" name="email"><br>
<input type="submit">
</form>

</body>
</html>

html page to view results

<html>
<body>

Welcome <?php echo $_POST["name"]; ?><br>
Your email address is: <?php echo $_POST["email"]; ?>

</body>
</html>

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote