Skip to content

Catch array of HTML multiple select with PHP

I have two multiple selects declared as: I want to catch the values in PHP, like this But the values come like this (with print_r on the $_POST): instead of: How can this be achieved? Can anyone help? Thanks in advance. Answer Try changing the names of the fields on the form to the indices at which you want t…

php counting issue using array_walk

I had something very different and was having issues with an array_map code I had written. I asked for help and someone was nice enough to suggest he code below. However it seems to have a couple of errors and since I didn’t write it and am not as familiar with array_walk I could use some help getting i…

PECL PCSC install on PHP 7.4

I am using PHP code that relies on the package: https://pecl.php.net/package/pcsc Finally I need to update from PHP 5 to PHP 7 (late enough). The REMI repo for CentOS unfortunately does not support PCSC for PHP7 anymore so I tried to install it manually by using the command: But I get a bunch of errors (see b…

PHP session variable name as string

I have a string coming from db like session_user_id denoting that I should grab the user_id from the session variable in PHP. This should ideally translate to $_SESSION[‘user’][‘id’] where the value exists. The following doesn’t seem to work. I have tried the variations like $ses…

PHP, MySQL date calculations

I’m trying to add a number of weeks to date, both will be taken from a database, I successfully fetch both needed but I can’t figure out how to make the calculations. So far I tried with “strtotime” but it gave me some weird results How do I do this the right way? The desired result sh…

Laravel 8 form to update database

I am creating a simple blog site with CRUD functionality in Laravel 8. I have done this before using the deprecated Laravel forms, but am now trying to do it using HTML forms. However, I am having some problem with the update part of the website. I have a controller called BlogsController with this function t…

Laravel 7 does not display flash message

I’m not sure if it has anything to do with it, but I believe it may be something related to my routes, I may be talking nonsense. No flash message is being displayed, I was only able to display a message by setting it to Session::put, retrieving it in the view and then deleting it. When I use with, with…

getting the value of an object with php [closed]

Closed. This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed last year. Improve this question i have a code that is supposed to get the number of rows in a database that contains the ip ad…