I have a table which contain two buttons, one is for uploading a file and the other one is for giving score. What I want to do is to give a condition for the second button which is the scoring button, whereby it can’t be clicked (disabled) if there is no file uploaded. How can I achieve this? Here is
I have a 500 error with preg_match syntax
I’m dealing with this php script, which when executed on the host gives a 500 error, apparently the line where the preg_match is is the one that contains the error… this file is going to be executed as a cron to validate. Answer You have extra double quotes in the regular expression. You also have extra spaces inside the []
Cannot clear laravel migrations because of invalid database url config
I accidentally added a wrong database url to my Laravel config now every time I try doing anything with artisan I get this error I already removed that line but now I can’t clear the cache for the config and every time I do anything with artisan I get the same error even when I just run php artisan help
Laravel Eloquent where statement returns no attributes
So from my previous post, I was advised to start using Eloquent models, which I did. My end goal, is to print out specific gifts, that belongs to that specific box. Migrations: gift_items: gift_campaigns: Pivot table: Controller: Error that I receive using this way: Seems like the updated version is trying to call the gift_campaigns table id, instead of the
Symfony Entites vs CollectionType
I have the following problem with Symfony. I made 3 entities: Customer, Cart, and CartItem. And what I want, is to display all the Products that are inside Cart (These are inside Cart Item), and to be able to change quantity on ever single one with some kind of form. The best way is to use CollectionType, but I get
Laravel Mail attach method – Attached file not opening after downloading
I have used the Laravel Mail attach method to specify file attachment for the mail being sent. The file attached successfully but cannot be viewed. ->attach(route(‘download_attachment’, ‘file=’ . $attachment->name)); One thing I noticed though is that if I generate the link in the email being sent, people can also only download it if they are authenticated. So, I am thinking
laminas authentication – redirect to login page when using a listeneraggregate
I am migrating an app from ZF2/3 to Laminas. I have moved the authentication from the Module.php bootstrap, to an aggregatelistener, and would like to redirect to a login page if the user is not logged in for certain routes. This worked fine originally, but i am having trouble after the migration – it is now redirecting 20 to 30
Modal validation using Bootstrap Modal – PHP
PHP Script & Validation: Modal: I don’t know where the problem is, I want the modal to remain open even if the problem or form has been submitted successfully. Now, with this code, if there is a problem with the submit form, the modal shuts down and if we open it again, the user can see error messages. Where am
Create order details shortcode for WooCommerce
Hey I am trying to build a shortcode for my order details on the order received page. The code below will generate the last result and then on top of it, it will display the word Array. My guess is that something in the foreach loop i am creating is still an array, but I dont know what to do
Acessing values from preg_match_all in PHP 7.4
I am trying to access the values from the results of preg_match_all. Below is my coding: Below is the results of ensuring there are values: This my attempt to access the page location, i.e. 465,5400 etc.. I have tried various ways and (3 indices and 4 indices).I always end up with an error message – Array to string conversion error.