When logging in, the system will retrieve information from that account and show it through the view page, which when we want to press a button to another page to display the information on that page …
Show record of logged in user in laravel
I want to show a list of complaint of a logged-in user how would I write if else in a blade. @foreach($data as $row)
{{ $row->type }}
…
Infinite Scroll won’t load more posts on scroll down when included in another file with HTML tags on top of it
I have an Infinite Scroll that loads more data (from DB) upon scrolling to the bottom, However, when I try to include that file in another .PHP file and write any HTML tag at its top, it won’t load …
How to use renderSection in Codeigniter 4?
From the official documentation of Codeigniter 4 for view layouts there is a function renderSection that you can use at your templates. The main problem though is that I couldn’t figure out how this works. Please have in mind that I don’t want a work-around for this, I really need to know how the …
Allow only certain inputs to be POSTed
My web application has three possible input fields, two of which are required and one of which are optional. They are $_POST[‘name’] (required), $_POST[‘message’] (required), and $_POST[‘identity’] (optional). In order to stop spambots from posting, I thought about making a…
Session variable in PHP allows me to log in even though credentials are incorrect
I have a question about sessions. I noticed something unusual when I was testing my PHP code. Basically, I have two courses and the credentials are stored in their own database. Example: Course 1: Username: abc Password: 123, database table: flitpc Example: Course 2: Username: abc Password: 999, database tabl…
how to combine PHP arrays from form entries
I have a form that allows the user to select multiple “keys” and then dynamically add any amount of values after. I need to combine them tied to each “key” to insert as rows in CSV. example data from form submit: Output as: Any help would be appreciated. Answer Example code to start wi…
PHP- difference between instantiating a class and returning the instantiation
The normal class declaration and instantiation: The class declaration and instantiation with return: What is the difference between these two in PHP in terms of using the classes? Answer If you just return new FooBar() it will just execute its __construct method if it has. But you can call methods without ass…
Why is my field validated even if it’s not required?
I have a request that takes several input. I want the ‘salary’ input to be validated only if the salary_type is equal to “exact”. Else, I don’t want to have any message about it. However, …
It is possible to pass 2 differents types of parameters to a Laravel controller?
I already have a GET route with an URI /projects/{id} which displays Infos of a project with a given id. I also have a GET index route (/projects), which shows all my projects. My problem is that I …