A user can be sent to the main website by some referral id, using a query string: And when they click on a link to a login area, this query string must go with that external link: I am working with wordpress, so I cannot append ?ref=<?php echo $_GET[‘ref’]?> to that link. I have already chan…
Double HTTP Authorization
I am currently working on a project that I’ve decided to go with basic HTTP authorization at the admin area for simplicity, however the company I’m working for already has HTTP authorization on their staging server and I was wondering if it is possible to have double HTTP authorization? Looking at…
Ionic PHP connection in Android APK
For a school project we are working on an app with the Ionic framework that needs to connect to an external PHP file. When the user submits a form, the input has to go to the PHP file, get dropped in a database, and also return a value in the app. We’ve got everything working locally, as well as in
Serialize/deserialize nested objects to JSON with type in PHP
I have classes that extends an abstract class. I need to create instances of these classes through a string – preferably JSON. Many of the objects are nested, and many properties are private. I need a way to: Create a JSON string of the complete object (with private properties and nested objects –…
When should I use static methods?
I have a class that is containing 10 methods. I always need to use one of those methods. Now I want to know, which approach is better? OR Answer It is an interesting subject. I’m gonna give you a design oriented answer. In my opinion, you should never use a static class/function in a good OOP architectu…
Load an image through jQuery Ajax
I am creating an application which browses a large amount of pictures. At this point, that portion of the project is done and it sorts, filters, and loads the correct pictures, and even splits them …
Unable to start laravel development server on linux
I am using laravel 5 for my project and everything has been working fine but recently I am facing this problem which I done understand. devboy@devboy-hp ~/sonel_ims_project/ims_eneo $ php artisan …
DateTime with microseconds
In my code, I’m using DateTime objects to manipulate dates, then convert them to timestamp in order to save them in some JSON files. For some reasons, I want to have the same thing as DateTime (or something close), but with microseconds precision (that I would convert to float when inserting inside the …
Check if one of multiple words exists in the string?
I have a string like this: I want to check it for these words: it, test. I want to it returns true if there is at least one of those words in the string. Here is what I did: (though it does not work) How can I do that? Answer Simply checking using preg_match(), you can add many different words
Laravel blade “old input or default variable”?
I want to show the old input in input value. If there isn’t old input, than show other variable: But when there is no old input, it gives me 1 instead of the default value! I think the problem has something to do with the concatenation, but I don’t know how to fix it!? Answer or is a comparison op…