Categories
CMS Development Wordpress

Errors while using ajax from external wordpress page

I am trying fetch WordPress user data from an external page within same domain using ajax.The problem is i am getting errors which contain the user data and source code from one of my plugin. here is my code external_page.php <?php require ‘./wp-load.php’; $type=isset($_POST[“type”]); if ($type==”showlist”) { //here data is fetched from wordpress database foreach […]

Categories
Development

How do I access the value of a td (x3) of the same tr (x1), if I click on the tr (x1 of td (x2))?

How do I access the value of a td (x3) of the same tr (x1), if I click on the tr (x1 of td (x2))? $(document).ready(function () { $.ajax({ url: ‘/api/Usuario/GetPermisosRolPorUsuario’, method: ‘GET’, dataType:’JSON’, data: { NitEmpresa,NombreUsuario }, headers: { ‘Authorization’: ‘Bearer ‘ + sessionStorage.getItem(“accessToken”) }, success: function (data) { debugger $(‘#tblBody’).empty(); $.each(data, function (index, […]

Categories
Development

JQuery defining a name of a variable outside of a function

I have a generic function in which I am attempting to pass variable “names” that will be used in a for…each loop. The code ultimately will populate a BootStrap IO Select component. The function is calling a Web Service using AJAX but since so many of the methods are similar, I figured it was best […]

Categories
Development

Tabulator 4.5 – Attempting to set Credentials and Capturing Events

I am fairly new to Tabulator. I love all of the features. However, I cannot figure out how to set the xhrFields and beforeSend(to pass xhr.setRequestHeader Authorization) within the tabulator variable declaration. I have searched the documention and examples and cannot find an answer. To explain what I am doing: 1. We have a backend […]

Categories
Development

Can’t send Post Data from Ajax to asp.net core web api?

I need to send an ajax request to a post method defined in my asp.net core web api as below : // POST: api/Entreprise/Inscription [HttpPost(“Inscription”)] public IActionResult Post([FromBody] UserInfos value) { return Ok(“value 1”); } and this is UserInfos model: public class UserInfos { public string firstname { get; set; } public string lastname { […]

Categories
CMS Development Wordpress

Loop through WordPress API response errors

I am having trouble parsing my AJAX response from my WordPress API that my hybrid mobile app is making. Below is (one of many ways I have tried to parse the response all of which have not worked): var $team_url = ‘/wp-json/wp/v2/team-post?_embed’; $.ajax({ url: $base_url + $team_url, async: true, dataType:’json’, type: ‘GET’, beforeSend: function () […]

Categories
CMS Database Development Wordpress

How to submit the custom form data in database in WordPress without plugin?

I have a created a contact form in the function.php and added short code on my page and it’s working. I am getting my form. function st_contact_form(){ ob_start(); ?> <div class=”contact_form-wrapper popup-contact-form”> <form action=”” method=”post” name=”contact_form” id=”contact_form” autocomplete=”off”> <div class=”row”> <div class=”col-xl-6 col-lg-6 col-md-6 col-sm-12 col-xs-12 “> <div class=”form-group”> <input type=”text” name=”name” placeholder=”Name” class=”form-control” required> […]

Categories
CMS Database Development Wordpress

How to submit the custom form data in database in WordPress without plugin?

I have a created a contact form in the function.php and added short code on my page and it’s working. I am getting my form. function st_contact_form(){ ob_start(); ?> <div class=”contact_form-wrapper popup-contact-form”> <form action=”” method=”post” name=”contact_form” id=”contact_form” autocomplete=”off”> <div class=”row”> <div class=”col-xl-6 col-lg-6 col-md-6 col-sm-12 col-xs-12 “> <div class=”form-group”> <input type=”text” name=”name” placeholder=”Name” class=”form-control” required> […]

Categories
Development MySQL SQL

How to pass mysql datetime to input datetime-local

I can’t pass datetime mysql value to datetime local input field MYSQL Data: 1995-10-29 08:00:00 Ajax: function getTransaction(id){ $.ajax({ type:’POST’, dataType:’json’, data:{id:id}, url: ‘queries/getTransactionInfo.php’, success:function(e){ $(“#pickup_date”).html((e[4])); $(“#return_date”).text(e[5]); } }); } php: $select = $mysqli->prepare(‘SELECT * from tb_transaction where `id`=?; ‘); $select->bind_param(‘i’,$id); if($select->execute()){ $result=$select->get_result(); $id=0; while($row=$result->fetch_array()){ $data[]=$row[‘requestor’]; $data[]=$row[‘requestor_email’]; $data[]=$row[‘pickup_location’]; $data[]=$row[‘destination_location’]; $data[]=$row[‘from_date’]; $data[]=$row[‘to_date’]; $data[]=$row[‘purpose’]; $data[]=$row[‘no_passenger’]; } echo […]

Categories
AJAX Development jQuery PHP

How can I post data through jQuery Ajax to php?

What is the error in my ajax ? I am trying to pass data to php page but my code is not working? please help me out $(document).ready(function(){ // inter first science $(“.ifs”).click(function(){ $.ajax({ type:”POST”, url:”http://localhost/routine_ms/make_routine.php?day_id=1″, dataType:”json”, data:{cat_id:”working”} }); }); my php file $cat_id; if (empty($_POST[“cat_id”])) { $cat_id = “empty”; } else { $cat_id = […]