I hope you are well. I am creating a Learning Platform in pure PHP with MySQL and AdminLTE3. I got to the time of creating the file manager for each user and got stuck on the following. I have the following structure in folders: /var/www/html/uploads/users/<% hash (USER ID)%>, and what I’m looking…
Tag: php
Laravel 8.38 validation issue, max file size. RuntimeException: The file {public path} cannot be opened. in file Psr17Factory.php on line 46
Created the file validation as (for test purpose it is 5kb) There is a weird issue, as it is displaying a valid error on uploading png but on uploading mp4 it is throwing following error Answer Open icons tray on right side of your windows. left click on wamp icon. click on PHP > PHP Settings > upload_m…
Laravel 8: Call to a member function notify() on string
I’m working with Laravel 8 to make a forum and now I wanted to send a notification to a user who has asked a question whenever someone answered that question. So in order to do that, I added this to the Controller: So the $question is the question id and $asker is the user id of the person who has
How to export Google analytics data without a view id
For the last 2-3 days i am trying to somehow download the “Pages and screens: Page path and screen class” reports so i can include the data on my management system, I tried to use the Google Analytics API in PHP, here is an example But as mentioned in the code my Google Analytics account doesnR…
How to make a script which outputs the ratio of the factorials of two numbers (N! / M!)?
I have a code that find n factorial: but, how can I find the ratio of the factorials of two numbers (N! / M!)? Answer You can add a return in you function and call her 2 times:
Return a view with Laravel Octane Route
I’m trying to use Octane routing with Laravel in the routes/web.php file. The code above works, but how can I return a view with data. I tried many things, but nothing is working. Is it possible to return views like the Route facade with Octane ? Thank’s for help ! Answer Laravel has a lot of magi…
Can an XMLHTTPRequest capture form data, and be sent to a PHP cURL request to be posted?
I have a javascript file that captures form input, makes an XMLHTTP POST request with the input, and handles errors. I am currently POSTing to a separate PHP file, as the request requires sensitive API data and needs encoding. From the PHP file, I then send a cURL request to post the form input to the remote …
Why Apache RewriteRule treats the same way with ‘&’ and ‘?’
I’m trying to code a custom rewrite rule for ‘.htaccess’ file in my Apache webserver. The main idea is to handle requests in the form: to ‘index.php’ file in the www_root: As everyone knows, this is easy to do. Just by adding below lines to ‘.htaccess’ file: But the p…
select all records and the rest
here is a simple mysqli query to select specific records from my mysql database: The question is: How can I get (best practices) all the other records, which will not be selected with this query filter? Answer Running successive, more or less identical, queries in a loop is fundamentally a bad way to do thing…
Is there a way to make a sidebar with the default Bootstrap 4 widget Yii2
I want to know if there is a way to make a sidebar with Bootstrap 4 default NavBar widget Answer https://github.com/kartik-v/yii2-widget-sidenav Helped me for this one, realy usefull.