I am making an osclass plugin. I have added a page for my plugin in the admin section of the site. I have also created a route for my plugin. What I would like to do is create a form on my plugin’s page in the admin. The action attribute of this form will be the base url of my
How can i replace all specific strings in a long text which have dynamic number in between?
I am trying to replace strings contains specific string including a dynamic number in between. I tried preg_match_all but it give me NULL value Here is what i am actually looking for with all details: In my long text there are values which contains this [_wc_acof_(some dynamic number)] , i.e: [_wc_acof_6] i w…
How to display data inside a single form from database
I am trying to display data from database inside single input form. Let’s say I have 3 rows with column called name. This is how I am getting the rows: So how do i display the data in one input form instead of three? like in the picture attached. Answer When you are doing this: You are essentially creat…
How to send the PHP value back to the HTML form?
I’ve been trying to build a program using PHP cookies. The user interface basically looks like this. My basic program The logic is this. When the user enters the product name, price and quantity and clicks on the “Add” button, the total value which is price*quantity will fall on the “T…
Connecting to PGSQL over SSL via Red Bean PHP
This a pdo method, i need configure red bean connection for ssl pgsql connection Answer You definitely need to write the full path to certificates and keys, otherwise nothing will work. sslmode=verify-ca; better use sslmode=verify-full
PHP / HTML: Optionally add further filter options to search a database
Currently, I have a dropdown menu to select a specific column of a table in my database with a text field to search through column for matches. Nothing special so far, it just looks something like this: Now I would like to add more filter options, where I don’t want to just write this code excerpt repea…
Laravel : Cant Create Multiple Data Relation with Foreach
I have a problem when creating data with the Maatwebsite/excel import. In my import class, I want to create data with the relation, when I try the dd variable that contains child data its works …
How to play video both locally and from url using php
I have reviewed several similar codes, I have tried them all, but they all work when the multimedia file is hosted locally, when the multimedia file is in a url it does not work, it does not play the video. They could suggest what changes should be used for this script to work on both url and local media file…
Xdebug not available in Composer plugin
I’m trying to debug a Composer plugin with Xdebug. I have my environment set up (export XDEBUG_SESSION=1) and the Xdebug loaded in php.d. The script breaks at first line in Composer so everything …
PHPUnit Larvel execute ONCE before testing
I use Laravel 8 with PHPUnit 9.3.3 Now I has written in CreatesApp.php: And this code executes every test and I want this code executed ONLY before testing: Answer If you want to execute some commands only once at startup – you can bootstrap tests with your own boostraper: docs But, your way is not corr…