Category "php"

Can we define variables in `.tpl` files?

In general, if we have a Smarty project we assign variables in .php file, and use the variables in its corresponding .tpl` file. such as: $smarty->assign('

Get empty result api firebase [FCM]

I've saved some of my mobile registration_codes that are connected with my development environment of Firebase. Once I send a manual notification by the api I r

could not find driver Debian SQL Server PHP

I have a Laravel installation running on a Debian 9.9 server and PHP 7.4. I need to connect to a SQL Server database on a remote Windows server. I followed th

Json_Encode not returning html even i try to encode JSON_HEX_QUOT | JSON_HEX_TAG

I want to return HTML from PHP. I found a solution from StackOverflow which is insert JSON_HEX_QUOT | JSON_HEX_TAG after array in json_encode but it does not wo

Send POST data via raw JSON with Postman

I've got Postman (the one that doesn't open in Chrome) and I'm trying to do a POST request using raw JSON. In the Body tab I have "raw" selected and "JSON (appl

CS-cart - assigning variables into config file

In my CS-cart 4 PHP project I have a Smarty 3 (tpl) view file.. There I have defined one JavaScript function like: <script type="text/javascript">

Distribute array row data to make multiple new rows

I have below the data [ { "price_in_dollar": 1000, "price_in_euro": 1000, "price_in_pound": 1000, "price_in_rupee": 1000,

How to send parameters in soap request in php in __soapcall() function

i want to send a below xml request to the server which is sending ok by using soap UI but not in php: <ns:AgentLogin> <ns:AgentLoginRQ

Is there a way to manually store Kafka offset so a consumer never misses messages?

Using PHP Laravel Framework to consume kafka messages with the help of the mateusjunges/laravel-kafka laravel package. Is it possible to save the offset by cons

How to see discount price only the product page in opencart

I have an extension. Customer discount. I want to see the discounted product price at the cart and at the bill. How can I do it?see what I want <?php class

Add 2 Webcam in one page with WebcamJS

I'm trying to add 2 or multiple webcam input with webcam.js from jhuckaby. But only one will works perfectly. And i'm following this tutorial https://pixlcore.

How to convert the int value to inch in PHP [closed]

I just want to know how to convert inch based on the integer inputted in the field. For Example: $int = $_POST['int']; //value 1 //computat

how to remove white space in select 2

I had dynamically added the value of the option in select2 as it came from the database but when the field has no value the space can be selected. How should I

file_put_contents causes page to refresh

I am calling a file_put_contents() inside of a PHP script that is executed via AJAX. Whenever I execute this script the client page gets reloaded which is not d

Add Class in html Dynamically in PHP

I am trying to add class in anchor tag dynamically by using Java script or Jquery. I have find many solution but not what i am looking. I am want to use PHP dyn

GRPC installed successfully on ubuntu but php is looking for it in another folder

Using PHP 7.4 & Ubuntu 20.04 LTS I have installed GRPC using these steps: sudo apt-get install autoconf zlib1g-dev php-dev php-pear sudo pecl install grpc

Cache clear probem in Larave

I have a problem. I am download project from hosting. now when I run the project this error shows. pic attached. I think this is cache problem, I clear cache, v

WooCommerce - unset "<product> removed notice…" on cart page

actions and filters. On my WooCommerce site I get the following message when I remove a product from the shopping cart: "<product name>" removed. Undo?

PHP each() function replacement

I read a textbook and it said each() function is deprecated. The author has recommend his own replacement for each() function called myEach() as following: func

laravel-websockets in production with reverse proxy and docker cannot establish connection

I am using laravel-websocket successfully in local and staging environment. However, when in production, I get the error WebSocket connection to '<URL>' f