I have a database table “movies” with three fields: id, title and user_id. Behind a login users can create new movies with a custom title. The user_id is set automatically to the current logged in user. Now on another page (also behind the same login) the users can see all their own created movies…
Why my modal window is replicated in all views
I am in the creation of a modal window but this window has something very particular and it is that I only want it to be displayed at the moment of logging in, that is, after the user enters their credentials. At the moment I am presenting an error and it is that the window is being shown in all
Either session expires in the middle of work or Warning: session_cache_expire(): Session cache expiration cannot be changed when a session is active
Using PHP 8.0.6 on Windows 10 locally I received this error message: Warning: session_cache_expire(): Session cache expiration cannot be changed when a session is active in C:pathsessions.php on line 5 I updated the same file on the live Linux server (PHP 8.0.9) and the issue doesn’t occur. The relevant…
How Can I Identify Which Linked Was Clicked With PHP?
I have connected to my database with PHP and selected a bunch of names with a query. Each name has an id value. I created a while loop that loops through the results and outputs something like this: (id only displayed for explanation purposes) At the linked page I want to run a query like SELECT * FROM databa…
Convert Looping from php to twig
I want to change the command from php to twig : Answer Here’s one way of doing this https://twig.symfony.com/doc/3.x/tags/for.html
How to get duration between mysql records created_at timestamp using laravel 8
I would like to find out how long an event lasted without having to add a finish time to that event. To demonstrate I have created a simple exercise: events table: I am currently pulling the data out of the database with: which returns the following: I would like to take the start time for the next event and …
Render WooCommerce Block ‘Product Filter – Attributes’ in code rather than via backend
WooCommerce provides the Gutenberg block “Product Filter – Attributes”, which you can add to the sidebar or footer widgets or basically everywhere, where you can add Gutenberg blocks. …
How to force creating a new Symfony application for a specific PHP version?
I want to generate a Symfony application which can be compatible with PHP version up to 7.4.22. On my local machine, PHP version is 8.0.2 but on the hosting is 7.4.22. Symfony application is generated from local machine using standard composer command I look over create-project arguments to see if I could add…
Can I implement an interface and override the return type of one of the interface’s methods?
I have a Task class that extends an abstract class, TaskBase. This TaskBase implements an interface CommanTask, which contains the following method. Now I need a new task class TaskMultiple, and it’s process() method needs to return an array of ProcessResult instead of one ProcessResult. How can I exten…
Htaccess giving 404 error on Aws Linux 2 AMI
I have set up an elastic beanstalk and deployed my application to it, the application has a .htaccess file in it. .htaccess works perfectly on my localhost but when checking it on the live server it gives back a 404 error. For Example I have a login file named login_1.php, on my .htaccess I’ve set the f…