我正在尝试在我的网站上集成支付网关。有三门课程,每门课程都有不同的价格。我正在传递金额和包的值,并且我已经使输入字段只读,但用户仍然可以更改检查元素中的金额并将其设置为0并传递值并免费获取课程。如何阻止用户更改值?或者有没有其他方法可以传递值?还是加密它,然后再次解密?form.php
这是我的代码index.php
<div id="outer">
<div class="box">
<h4>Rs. 9,900/-</h4>
<ul>
<li>2-Days Classroom Training</li>
<li>E-Learning Course</li>
</ul>
<form action="form.php" method="post">
<input type="hidden" name="amount" value="9900" readonly="readonly">
<input type="hidden" name="package" value="basic" readonly="readonly">
<input type="submit" name="BUY NOW" value="BUY NOW">
</form>
</div>
<div class="box">
<h4>Rs. 11,900/-</h4>
<ul>
<li>4-Days Classroom Training</li>
<li>E-Learning Course</li>
</ul>
<form action="form.php" method="post">
<input type="hidden" name="amount" value="11900" readonly="readonly">
<input type="hidden" name="package" value="standard" readonly="readonly">
<input type="submit" name="BUY NOW" value="BUY NOW">
</form>
</div>
<div class="box">
<h4>Rs. 14,900/-</h4>
<ul>
<li>4-Days Classroom Training</li>
<li>E-Learning Course</li>
<li>5 Hours Personal Session With The Trainer</li>
</ul>
<form action="form.php" method="post">
<input type="hidden" name="amount" value="14900" readonly="readonly">
<input type="hidden" name="package" value="pro" readonly="readonly">
<input type="submit" name="BUY NOW" value="BUY NOW">
</form>
</div>
</div>
form.php
<body>
<?php
if (isset($_POST['amount']) && isset($_POST['package'])) {
$amount = $_POST['amount'];
$package = $_POST['package'];
}
?>
潇潇雨雨
一只斗牛犬
牧羊人nacy