Back to (PHP) basics. Creating your own SEO friendly “mini-website” in PHP

Created at: May 27, 2016; Last update: August 12, 2016

I want to be noted that this is not a tutorial about creating an MVC framework from zero. If you want that kind of tutorial, you can find a lot of them (https://www.youtube.com/playlist?list=PLfdtiltiRHWGXVHXX09fxXDi-DqInchFD https://www.youtube.com/playlist?list=PL7A20112CF84B2229).

There are moments in your programmer life when you are asked to do a small “landing page”, which actually turns out to be a “mini-website” with an “About” page, a “Contact” page and a few other pages. Continue reading

Login (and register) with Facebook and Ion Auth

Created at: May 23, 2016; Last update: August 11, 2016

A lot of people asked (including a very generous donor called Federico), so why not try to do it?

I must start by telling you that this may not be the best way of doing it but it is a basic one…

So let’s start. In order to start doing our Facebook login we first need to take a look at the documentation from Facebook (https://developers.facebook.com/docs/facebook-login). This documentation says that in order to login with Facebook we first need to set up an “app” with an ID and a secret key (https://developers.facebook.com/docs/facebook-login/web). We do this by going to our App Dashboard (https://developers.facebook.com/apps/). In there we can create a “Demo” app, which is good for our testing needs. Continue reading

Meet Tusker – a small task manager for your projects

Created at: April 8, 2016; Last update: April 8, 2016

Hello again. I would like to present to you a small project I am working at. It is called Tusker, is made using CodeIgniter 3.x, and it is a simple task management web app. I sure hope you give it a try and tell me about new things to add to it. The Github repository can be found here: https://github.com/avenirer/Tusker

Continue reading

“Why develop a web app with CodeIgniter in 2016?”

Created at: April 7, 2016; Last update: April 7, 2016

This question was proposed as a subject by one of this blog’s visitors. It is indeed a good question, especially considering that “CodeIgniter remained way behind other frameworks”.

So let’s think a bit about why would we use an “aged framework” when we have great frameworks like… and here the typical example is Laravel. Continue reading

How to make “truly” SEO friendly URLs in CodeIgniter (without “duplicate content” on underscore URLs)

Created at: March 23, 2016; Last update: March 24, 2016

I promised myself I won’t do anymore tutorials regarding CodeIgniter until a new version is about to appear, but I can’t help myself. And this subject seems more than appropriate for a new tutorial.

Let us start with the beginning. In routes.php (application/config/routes.php), we have a configuration parameter called “translate_uri_dashes“. If we set this parameter to TRUE, the CodeIgniter framework will translate the dashes (“-“) in our urls into underscores (“_”) when calling a controller or a method. This, of course is what we want in order to have “SEO friendly” URLs (although I think it’s strange that up until this moment, search engines can’t interpret an url). Continue reading

How to remove (redirect) trailing slashes from URLs using .htaccess

Created at: December 22, 2015; Last update: February 19, 2016

Well… I see a lot of questions regarding SEO friendly URLs, and also regarding the problem with URLs that have trailing slashes which show the same content as the URLs without trailing slashes. Although I really hope that the search engines are smarter than treating those URLs as duplicate content, I feel there is the need to know how to redirect them to the non-trailing slashes URLs.

So here it is. You open .htaccess, and you should have in it the following:

This should work for anything, not just CodeIgniter. Hope this helps…

accordion

How to create an accordion in jQuery

Created at: December 21, 2015; Last update: December 21, 2015

Well… I should start by saying that I actually hate Javascript and jQuery (sorry, guys…). If you really have to ask me why, the reason I hate it is because of the time I had the first encounter with it. It’s rather a psychological reason. The first time I took a look at Javascript was in its infancy. I was amazed at what it can do… But then I opened the same html file with another browser… it was a disaster. Then… another browser… another disaster. That is why I hate Javascript. Now someone may say that this is no longer a problem. Most browsers (if not all) are not respecting the Javascript engine directives (or whatever you call them…). But, as I said, it is a psychological hate. Continue reading

Register users using Ion Auth in CodeIgniter 3

Created at: October 29, 2015; Last update: March 1, 2016

What we will learn in this episode

OK… We’ve installed Ion Auth and made the login page. How about allowing users to register an account? In this tutorial we will find out how we can use Ion Auth in order to allow users to register for an account. After this we will see how to change the controller so that only administrators can register new users. Continue reading