I am really new to server-side programming, so this question might be easy for you. Let us say that I have a web-server installed on my computer. When I publish my website, it would come to the internet. I have XAMPP installed, which includes everything required. Now, most of the people who visit my website w…
Tag: php
How make default profile picture in express js
How can I can make default profile picture when the user have not upload there picture? I want to display default profile picture for them, like png. I have done some thing similar in php but I don’t …
Dropdown list in HTML using PHP
I need to take UniversityID from the University selection to list institutes in this university for Institute Selection. I read it is easy with AJAX but I couldn’t solve it. For now Institute …
Files are repeated when uploading pictures to Laravel
I want to do bulk image upload on my blog that I write in Laravel. Wrote the code for loading images. Everything works, but the images are repeated After loading 6 images, I get this array of 21 elements. What’s wrong? Answer You’re appending $images to $urls on each image. Do it like this instead…
PHP autoload with namespaces do not load file
I have an issue with my autoloader and namespaces. Below the autoloader Below the index file The file for the class Person is saved in the directory root->include->Person I used the namespace in the class file like this If I visit the index file in the browser it returns ‘Class file not found̵…
Test whenever a value x is greater by exactly 1 compared to a value y modulo 3
How do I check that x is 1 greater (ahead) of y in a modulo sense (mod 3)? This is when x = 0 and y = 2, when x = 1, y = 0 and when x = 2, y = 1. I tried testing like this: It is not working for the case where x = 0 and
Is there a way to differentiate between a page refresh and pushing a submit button?
I have a form that, when submitted with a button, adds an item to a SQL database. However, the problem is that if I refresh the page after submitting, it will add another identical item to this database. Is there any way to tell when a user is pushing a button and when they are just refreshing the page? I
Where is the preload.php file, and how is it generated?
With Symfony 5.1 and PHP 7.4, I want to add preload.php in opcache. Symfony documentation : During container compilation (e.g. when running the cache:clear command), Symfony generates a file called preload.php in the config/ directory with the list of classes to preload. opcache.preload=/path/to/project/confi…
Sorting alphabetically by Array Value in Multidimensional Indexed Array After Custom Sort (usort) / Sort Array by Two Values
Original Array: Applied usort($terms, “mysort”); via the following function(s) This successfully ordered the array by the $sortOrder array in the getSortOrder function (base material first, and then color) Now I am trying to sort this new sorted array by name while keeping the previously applied s…
Getting error response while sending email from ionic using PHPMailer
I am trying to create a reset password page in ionic where the user enter his email ,to reset the password of his account on my application. The thing is that I want to send a response from php telling the user if the email was sent to his email or not depending on values sent from php to ionic.