I’m trying to learn PHP to solve an Assesment challenge, where I have to build a Product List & Add Product pages. Reading here and there, watching some tutorials I was able to develop this code so far: Index.php: Thing is, inputs for DVD Size, BOOK Weight and Forniture dimensions ( H, W & L ) s…
Tag: php
Fatal error when using foreach on 3rd array
I’m getting an error when trying to use foreach on 3rd array My goal is to get those data above and expect it to loop until its last data using this code: It returns this error Here is the line 25 Error on line 25 Am I missing something? By the way I’m working on a proxy dashboard for a
Subtract tax from a price with tax in OpenCart?
How do I subtract all taxes from a price with tax in OpenCart? In the example below I use the default “Taxable goods” tax setting from OpenCart, which is 20% VAT + $2,00 Eco-Tax. This returns an incorrect value of $14,64 because it calculates the tax on $number (20,80), which already is a price wi…
CSRF Token Mismatch with Laravel API using Digital Ocean Load Balancer with Sticky Session
I am working on a project in Laravel 8 which I am now testing the deployment on production servers. I have set up 2 Digital Ocean Droplets that are behind a load balancer with Sticky Sessions enabled. I am attempting to login via a SPA app with a separate Laravel API so the middleware is configured for the ap…
Is there any way to find a specific pixel area that is surrounded by a black border with PHP and Imagick?
I’ve been trying to use Imagick to turn PDF files in my PHP application into PNGs so that I can get Tesseract OCR’s PHP library to scan only handwritten text in the documents. The handwritten text areas are surrounded by a black border in the documents, and there’s a chance that they could b…
Sort By date in hasMany relation first record for Laravel project [closed]
Closed. This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 10 months ago. Improve this question I have a courses table and every course has many sessions, So I need to sort courses by th…
fputcsv() problem. Textarea isn’t saved in one column
Today, I found my limit in data operations knowledge. I can successfully save input fields as well as textareas by doing this: Later on, I can retrieve the data and store it in array by using explode()… or so have I thought! The problem is in me. I like BIG textareas. I am currently making a forum page …
Get data from a sub-array with json and php
I would like to obtain the value of “single_img” that is in a subarray but I can’t find the way. I appreciate your answers! Answer you can decode the string as an associative array and access your key:
Sort foreach results by html form input order
I have an html form that posts the content of an <input> field. This field accepts one or more values. If more than one value, then the user just separates with a blank space. Question: How can I sort the results by the exact order of the user input? E.g. User inputs the following by this specific order…
PHP string concat with slashes and variables
I am trying to exec an rclone command via a PHP script. The plain text version of the call looks like this: But when I run it, I’m missing a bunch of stuff and getting divide by 0 errors. I’ve tried a number of other combinations of / and ” and can’t quite get it dialed in. Answer If t…