Categories
PHP

null values being inserted into database

I have a REST API that should save the contents of a json into a mysql database however it’s inserting everything as null? However its weird because whenever the json is sent from the swift sdk it works just fine. public function saveTracking($request, $response, $args) { if(!$this->validToken($response)) { return $response; } $data = $request->getParsedBody(); $tracking_data […]

Categories
PHP

Converting smart quotes in WordPress content

I parse post content in WordPress Some content {field:”value”} some other content. …and whenever I find a JSON-object like string like this, I try to decode and run some other function with the value. Problem is WordPress saves user input {field:”value”} as {field:&#8220value&#8221} I know that I can simply convert content with a function like […]

Categories
PHP

Error when Running Codecept

I am trying to run a test and when I use the codecept command I get this error. Does anyone know how to resolve this issue? Error: Internal script failure codecept run tests/acceptance/RequestCept.php –steps ==== Redirecting to Composer-installed version in vendor/codeception ==== <br /> <b>Error</b>: <font color=”FF0000″><b>Internal script failure</b><br />

Categories
PHP

How to manually install a php extension

Im trying to install intl extention on mac environment, trying and can’t find a solution… also can’t install pecl… I’ve downloaded the Intl extension on my device and I’m struggling already the 3d day to install the extension. please help me. I’ve downloaded intl-3.0.0.tz Thanks

Categories
PHP

WordPress blog’s featured image showing on other pages

I adopted a site to help revise from the web company that created it and I’ve been having issues getting the featured image for the posts page to show up. I added code to the index file due to the site not having a front-page.php. It works (link here), but I see it appear on […]

Categories
PHP

How to passing data to model in Codeigniter?

I need to pass data to a model. that model is form to edit data. I have make array data in the controller for passing the data to models, but im still confusing to passing data to the models in codeigniter. this is my controller : public function edit($id_ekspor){ $eks = $this->m_ekspor->GetDataEkspor(“where id_ekspor = ‘$id_ekspor'”); […]

Categories
PHP

Table and buttons in html and php with bootstrap

In this code that have to print a table and 3 buttons, the 3 buttons appear above the table but i want them under the table. What can I fix? And how can i print them inline? I tried with a div with style display inline but doesn’t work. echo “”; echo “”; echo “Esperienze […]

Categories
PHP

PHP Infinite Multidimensional Array – Cloud Service API Folder and files listing

I’m working with a local cloud service API and I encountered a problem. I created a small script that can navigate trough the files and folders but it is very slow. So I decided that storing the folder array to a global variable. This way I will access all the information very fast and I’m […]

Categories
PHP

Assign MySQL AES_Encrypt to a PHP variable

I’m trying to encrypt and entered password and assign it to a PHP variable. There’s other means to ensuring the password is secure, but I’m just trying to get this section of it complete. I’m using Cloud 9. The code I’ve tried is: $password_enc = $row[“password_enc”]; $entered_password = !empty($_POST[‘entered_password’]) ? $_POST[‘entered_password’] : “”; $entered_password_enc = […]

Categories
PHP

Bootstrap don’t reload correctly

I have HTML/BOOTSTRAP 4 web page, and the main problem is that when I reload my page, for first I see only HTML code, and after one second Bootstrap is loaded. How to solve this?