Я проверил версия моего php, если он совместим с библиотекой, и моя версия php соответствует этому требованию, я также включаю расширение GD в своем php.
вот мой код на JavaScript с AJAX `
Код: Выделить всё
function sendEmail(userId) {
// Fetch user details via an AJAX POST request
$.post("admin_registration_get_details.php", { updateid: userId }, function (data, status) {
// Parse the returned JSON data
var user = JSON.parse(data);
// Populate the fields in the Send Email Modal
$('#permitBusinessName').text(user.business_name);
$('#permitOwnerName').text(user.fname + ' ' + user.mname + ' ' + user.lname);
$('#permitType').text(user.business_type);
$('#permitExpiration').text(user.period_date);
// Auto-fill the recipient email
$('#releaseEmail').val(user.email);
// Ensure only one click event is bound to the Generate QR Code button
$('#generateQRCodeBtn').off('click').on('click', function () {
// Send an AJAX request to the backend
$.post('send_qr_email.php', { email: user.email }, function (response) {
if (response.success) {
// Display the QR Code using the Base64 URI
$('#permitQRCode')
.attr('src', response.qr_code_base64)
.removeClass('d-none'); // Show the image
alert('QR Code generated successfully!');
} else {
alert('Failed to generate QR Code: ' + response.message);
}
}, 'json').fail(function () {
alert('An error occurred while generating the QR Code.');
});
});
// Show the Send Email Modal
$('#sendEmailModal').modal("show");
});`
Код: Выделить всё
Подробнее здесь: [url]https://stackoverflow.com/questions/79357345/endriod-qr-generator[/url]
Мобильная версия