I want to display an extra text field on the author page which I can fill in the respective user profile when I logged in. Additionally it would be great if the textfield has a WYSIWYG editor. How can I do that? Answer You can use the hook user_contactmethods to add some custom fields to the user page. See th…
Tag: php
Concatenating strings in PHP using require() without printing 1 as part of the output
My question is related to php include prints 1. In https://github.com/jaimemontoya/jaimemontoya.com/blob/dev/page.php I’m using this: The problem happens in echo $this->content;. In https://github.com/jaimemontoya/jaimemontoya.com/blob/dev/index.php I’m using this: The problem is the ‘1&#…
Passing data from the database to a blade view using a controller in laravel
I found several ways to do what I need to do, the first way was using the rounting using the web.php file. But according to serveral posts this creates vulnerabilities in the application. So I found out the correct usage is with a controller that manages the database queries. I created a controller, named Eve…
How to load an array of external data in QuickChart?
I am looking to use QuickChart in my PHP project. I skimmed the documentation completely. But, everything in it has the data being statically loaded as an array. I am trying to load external data, that is generated from somewhere else, into the chart. To understand QuickChart, I tried to load data dynamically…
How to get the id in modal and open their data to another page with php?
I want to get the id from this modal and pass it to another page like edit_appointment.php?id=’id from modal’ the problem is I execute my php code to different file and just use Ajax request to display my data to modal. I don’t know how to call the user id here a href=”” class=&#…
PHP viewing folder content
I am trying to create a file server. What I am trying to do is -> on the page there will be lots of folders displayed, when you click on one you will be shown its content and if there is a folder inside of this folder you can click on it and it will display the content of that
clang-format equivalent for PHP & HTML
From what I read clang-format is for c/c++/obj-c. Which tool like clang-format would you recommend to automatically format/reformat PHP/HTML code in a consistent way? And why? The use case would be to check code formatting in CI (continuous integration) when submitted through a ‘pull request’ for …
Laravel 8.x – How to use updateOrCreate with a where clause?
I am trying to use Laravel updateOrCreate to update a record if its within this month and last month based on if an ID exists. If the ID exists, and the result is in this current month or last, a new record is created instead of updated. Expected input: 1 (which exists from last month) Expected output: Record…
Catch inexistent static files in app.yaml
In app.yaml I have I would like to intercept / redirect non existent image files (gif | png | jpg). As it is, GAE returns an Error not found when requesting some inexistent file with the image extensions, I am looking if there’s some way -at app.yaml- level to intercept them. (I could remove the static …
Draw a horizontal and vertical line on mouse hover in chart js
I am stuck with a problem on chart js while creating line chart. I want to create a chart with the specified data and also need to have horizontal and vertical line while I hover on intersection point. I am able to create vertical line on hover but can not find any solution where I can draw both the line.