The format of both "sub.tld.org" and "tld.org.gr" is similar for php. But one of them is top level domain and the other one is a subdomain. explode(".", $tld) is not enaugh to find real tld in this case. This function helps to dedect all known tlds including multi-level regional tlds. It could be useful for fraud dedection or finding duplicate sites under different tlds.
This is a comparison of most popular content-management-systems Drupal 6x and Joomla 1.5 series.
Drupal pros: free, professional coded, multilang, multisite, performance, great community, flexibility, power, role-based user access, flexible content types, excellent taxonomy system, seo friendly urls, multi-db-support
Url manipulation is one of the hottest areas on the new generation web (2.0). It provides more security and flexibility. It is user and search-engine friendly. The most popular combination is Apache-webserver + mod_rewrite + server-side catcher(mostly a php-file). In this tutorial we use very short examples to make it easy for newbies.
Why url manipulation & mod_rewrite?
- more security: hide file location
- shorter urls without file extensions like .html
- easy to remember / recommend urls
- search engine friendly
Google Adsense internal search code does not work with Drupal sites normally. The reason is $_GET[q] conflict between both services. $_GET[q] means "current page" for Drupal and "search query" for Google. We can fix it with two easy steps.
Create a custom page like "websearch" etc under Drupal and add Adsense Code for results page.
Add this code at the top of your Drupal's index.php:
// Fix Drupal-Adsense conflict $_GET[q] = ($_GET['cx']) ? "websearch" : $_GET[q] ;
To prevent quality images being stolen, we can use PHP to watermark web-images in popular formats like GIF/PNG/JPEG. We print a transparent gif-image on a jpeg-photo in this tutorial. For best results I prefer gif than png, because some png formats require extra functions to print a transparent image. We can convert this script to a batch-watermarker easily to watermark photo albums/galleries with multiple pictures by putting code in a loop or create a function.
Webmasters want to know where all visitors coming from, which pages they visit and how long does it take webpages to load in miliseconds. This tutorial shows how to save your visitors/website details like referrer, browser/client, ip-address, langind-page in three steps. Remember if your scripts ends with exit() or die() command, footer code will not work. Just remove that commands or put them below footer code.
- Create your mysql table
- Add top-code
- Add bottom-code
Now there are multiple captcha types against spam/abuse:
How will next generation captchas look like? I think in the future there will be much more captchas types like:
number to text
word suggestion with add remove extra letters(ie: gogle, new yoork)
animals (ie: which animals do you see in this picture from left to right)
What do you think what more could be one of next spam-preventing technologies?
This is a multiple image uploader with flexible thumbnail generator. You can set how many images you want to upload at once. This script creates thumbnails automagically from GIF / JPEG and PGN images. You can also disable thumbnails completely. You can change easily path/to/upload and thumbnails max width and height. Script dedect automagically which dimestion to use for resize. It checks image-type and max-image-size. Comments and featurequest are welcome!
.htacces and Mod_Rewrite (Apache Webserver)
Password Validation with PHP and Regular Expressions
What is a good password? Your birthday, favorite star or first school, car, ...? None of them, because all similar passwords are very easy to crack.
My golden rule for safe-passwords is simple: Google or any search engine should NOT find any result for your password-string. But do not search for your password without changing some characters, because it will be visible as clear-text to all networks between your pc and Google server.