Category "php"

How to get Woocommerce product variation id into a PHP variable for use with custom add to cart urls?

Using Woocommerce, I need to be able to add a variable product to the cart within a custom add to cart URL, such as with the following example, where 88 is the

Laravel 9: Custom login

I am trying to change the default table that laravel 9 uses to authenticate the users. But while I can see that user is authenticanted in the login function of

how to prevent float variables displaying as scientific notation when printing [duplicate]

I am using "(float)$val" for some calculation, but for some decimal value like -0.00000025478625 (float)-0.00000025478625 is resulting to -2.5

Laravel 8 Multiple Relationships for Factory

In Laravel 8 it is possible to quickly fill relationships with factories. However, I cannot figure out how to generate more than one relationship. How can I cre

Normalize DateInterval in PHP

The situation/issue I have an issue with DateInterval in PHP. Given the following code $interval = new DateInterval("PT6000S"); echo $interval->h; // 0 echo

How do you reconcile the path of a file inside mySQL with the domain name your browser puts in front of it, to view it?

I'm successfully uploading some files to a folder and saving the path in table. If I display the file's path in an html table, hovering over it, the address on

Shopware 6 Installation error: Identifier dbal not initialized yet

In setting up the database installation on localhost, When I get to the database Installation section I have this error Error Received an error message. URL: im

php subpage repeating in link

I just implemented mod_auth_openidc authentication on an apache website and noticed that sometimes after sitting on a webpage for a few minutes, then navigating

Attempt to read property \"view\" on null when sending password reset email

I am trying to build password reset functionality but with a custom email template. So instead of returning the MailMessage from the notification I can sending

CSV to PHP class properties

I'm working on an assignment right now, and I'm trying to take the data from a CSV and make them into class objects. So each item in the CSV row needs to be a c

Call authenticate manually in router middleware

I created a CustomAuth middleware to use in routes to authenticate by "user_id" in request body or "Authentication" in request header. I need call Authenticate

SQLSTATE[42S02]: Base table or view not found: 1146 Table 'posts.post' doesn't exist

I'm very confused, i try to find what's wrong but i don't find it.. In my SQL Database i've 'posts' table created all my code are related with 'posts' table and

How to use form events to dynamically modify fields when i choice a specific value

I have some problems in my forum's project. I have one field named "Category" with choice list and i want to when i check the value "Characters" in this list, a

Fatal Error: Allowed memory size of 536870912 bytes exhausted (tried to allocate 262144 bytes) on line 3

I am getting this error in codeigniter 3. I had tried most of the things but none of them worked. function money_format($num = 0, $pro = 2) { %n

Docker 2.3.0.4 with Devilbox on Windows 10 WSL2 is extremely slow

I have windows 10 2004, 8-core amd cpu, 12gb ram, running an existing wsl2 debian instance just fine. I can run a typical web stack php-fpm nginx mariadb redis-

Installing PHP 7.4 manually (offline) on Linux Red Hat server

I have upgraded from PHP 5.3 to PHP 7.2 and the application is working. now I want to upgrade to PHP7.4, when I run the command './configure' '--prefix=/logi/ph

SQLSTATE[HY000]: General error: 1 table posts has no column named *

I'm actually new to Laravel and I'm trying to build a basic social network with this Framework. For this project, I created a page called post which users can a

How to get variable from JavaScript to PHP [duplicate]

i need to transfer a variable from js to a php page then insert it in the database the Js code function tableText(tableCell) { var x

How can I convert from a{a{} b{}} to a[a[],b[]] using php preg_match?

Group test { Group test1 { #-# Type Val 1 typ1 10 2 typ2 10 3 typ3 10 } Group test2 {

dockerizing Laravel + vue

Trying to migrate my Laravel and Vue code into docker but I am getting an error building the Image This is my docker file # dockerfile FROM php:8-fpm #