每当我添加ajax代码以向支付网关发送帖子请求时,我当前遇到500内部服务器错误的问题但是一旦我删除了ajax代码,页面就显示正常。
我也包含了ini_set('display_errors',1);
行,但它仍然没有效果。这是由于一些.htaccess
错误。
这是我的代码:
<?php
ini_set('display_errors',1);
session_start();
require('./connect1.php');
$postdata = file_get_contents("php://input");
$request = json_decode($postdata);
$firstname = $request->firstname;
$amount = $request->amount;
$productinfo = $request->productinfo;
$key = "LIKhkll";
$txnid = substr(hash('sha256', mt_rand() . microtime()), 0, 20);
$check = "SELECT `email`,`mobile` FROM `users` WHERE `username`='$firstname'";
$result = mysqli_query($conn,$check);
while($row=mysqli_fetch_assoc($result)){
$email = $row['email'];
$phone = $row['mobile'];
}
$surl = "http://fwebsite/payment/success.php";
$furl = "http://fwebsite/payment/failure.php";
$hash = '';
$hashSequence = $key.'|'.$txnid.'|'.$amount.'|'.$productinfo.'|'.$firstname.'|'.$email;
$hash = hash("sha512", $hashSequence);
?>