Skip to content

Keep query string for external urls

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

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 …

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