JOOMLA FICTION LAB
In php you can emulate an ajax request by inserting a proper header. With this header you can prevent users from directly accessing php pages that are meant only for ajax calls.

How to strip specific words from a string with php

by minitek Wednesday, 22 February 2012 11:46
With this simple php script you can remove any specified words from a string. This is very useful when you need to filter input to strip forbidden words.

How to shorten a text without cutting words in half in php

by minitek Tuesday, 10 January 2012 13:45
You can use this php script to shorten a text string into a specific number of words without cutting words in half and add three dots to the end of the string.

How to get the current page url in PHP and Joomla

by minitek Tuesday, 09 August 2011 10:41
When developing in php, you often need to grab the current page url (the one in the address bar) to use in a script. This is very common when developing widgets as the Facebook like button or even when you simply need to display the…

The 6 most important security settings in php.ini

by minitek Friday, 01 July 2011 07:09
The php.ini is a PHP configuration file that controls some important PHP settings. This means that with this file you can change the behavior of your PHP server. Whenever someone visits your website, the PHP interpreter reads the php.ini file and behaves accordingly. The settings…

How to get the file extension in PHP

by minitek Wednesday, 15 June 2011 22:38
There are many ways to get a file extension using php. Below is a list of the most frequently used methods to do this. In this tutorial we will be using the functions strrpos, strlen, substr, strrchr, explode, end, preg_replace and pathinfo. You can learn…

How to limit text characters in Joomla

by minitek Monday, 02 May 2011 10:11
Today I will show you how to limit the text characters inside a php file in Joomla. For this purpose, we will be using the substr() php function. The substr() function returns only a part of a string. Suppose we have the following text string…

How to convert a multi-dimensional Array into an Object

by minitek Thursday, 14 April 2011 00:03
In this tutorial I will show you a very useful function to convert any multi-dimensional Array to a multi-dimensional Object. For this purpose we will be using the default PHP Object stdClass(). The stdClass() even though is not so well documented, is widely used by…

How to redirect a page with PHP

by minitek Tuesday, 12 April 2011 11:10
In this tutorial I will show you how you can easily redirect a PHP page. We will be using the header() function. If any output is sent before the redirection is executed you will get this warning message stating that you can not modify header…