Category : ajax

I have a little problem, the point is that my array is not getting content. $staff = array( "permissions" => false, "staff" => true, "group" => 3 ); echo json_encode($staff); let staff = []; $.ajax({ type: "POST", url: "../includes/signin.inc.php", }) .done(function (data) { staff = JSON.parse(data); console.log(staff); }) .fail(function (xhr, status, error) { alert(status); }); ..

Read more

I want to create a captcha image for my WordPress ajax singup form. for this reason, I create a captcha.php file in root for generating images that worked successfully. session_start(); $permitted_chars = ‘ABCDEFGHJKLMNPQRSTUVWXYZ’; function generate_string($input, $strength = 10) { $input_length = strlen($input); $random_string = ”; for($i = 0; $i < $strength; $i++) { $random_character = ..

Read more

I was developing a simple web application. This shoul show the Id in the console. But it doesn’t. this is my js file. function get_record(){ $(document).on(‘click’,’#btn_edit’,function(){ var Id = $(this).attr(‘data-id’); $.ajax( { url: ‘get_data.php’, method: ‘post’, data:{UserId:Id}, dataType: ‘JSON’, success: function(data){ console.log(data[0]); } } ) }) } And this is my php function function get_user_record(){ ..

Read more

This code was found on this website https://www.geeksforgeeks.org/how-to-fill-all-input-fields-automatically-from-database-by-entering-input-in-one-textbox-using-php/ my aim is to fill all input fields automatically from the database by entering input in one textbox using PHP then insert it into another table but it keeps failing please help me. GeeksForGeeks User Id First Name: Last Name: // onkeyup event will occur when the ..

Read more