Find top level domain from international urls with PHP
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.
Drupal 6 vs. Joomla 1.5 (2009)
- Read more about Drupal 6 vs. Joomla 1.5 (2009)
- 9 comments
- Log in to post comments
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 with mod_rewrite and php-catcher for beginners
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
Fix Google Adsense Search and Drupal Conflict
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.
Step 1:
Create a custom page like "websearch" etc under Drupal and add Adsense Code for results page.
Step 2:
Add this code at the top of your Drupal's index.php:
// Fix Drupal-Adsense conflict $_GET[q] = ($_GET['cx']) ? "websearch" : $_GET[q] ;
Image watermark with PHP
- Read more about Image watermark with PHP
- 3 comments
- Log in to post comments
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.
Steps:
Page generation time and http-referers with PHP
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
SQL Query
Alternative captcha ideas for future
- Read more about Alternative captcha ideas for future
- Log in to post comments
Now there are multiple captcha types against spam/abuse:
image captcha
ascii captcha
audio captcha
math captcha
easy questions
How will next generation captchas look like? I think in the future there will be much more captchas types like:
car captcha
film captcha
famous people
famous places
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)
traffic captcha
What do you think what more could be one of next spam-preventing technologies?
Smart Multi-Uploader and Thumbnail Creator from GIF/ JPEG/ PNG with PHP
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!
Redirect webpages with HTML, PHP, .htaccess, Java+Script, CGI-Perl, ASP.NET and ColdFusion
Here are examples of code how to redirect an old page/url/domain to a new one with most popular client+server side programming/scripting languages. We use 301 http status code (permanent redirect). If you need temporary redirection use 302 status code instead of 301. It is better to prefer server-side redirection, because some clients are surfing with javascript and http-refresh disabled browsers. Do not forget to test your code first!
.htacces and Mod_Rewrite (Apache Webserver)
Check password strength / safety with PHP and Regex
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.