php

Photo Album / Picture Gallery Script with PHP


This is a all-in-one-file small and powerful image gallery script with PHP. Just upload your images to directory of script with FTP. It is free for private use. For a demo click on screenshot-image.

Features:

  • Scann directory and display images in web formats automagically
  • Create thumbnail images dynamically on the fly (from all JPEG, GIF, PNG)
  • Sort images by name, size or last modified time

Simple Hello World Module for Drupal 6

This is a small and simple "Hello World!" module for quickstarters who uses Drupal 6x series. We need just one directory and two files:

  • modules/simple_hello_world/
  • modules/simple_hello_world/simple_hello_world.info
  • modules/simple_hello_world/simple_hello_world.module

modules/simple_hello_world/simple_hello_world.info

; $Id$
name = Simple Hello World
description = Description of Simple Hello World module
core = 6.x

modules/simple_hello_world/simple_hello_world.module

<?php

Comparison of free Shopping Carts - 2009

This is a comparison of free -mostly open source- "shopping carts" / "e-commerce systems": Magento, osCommerce , Virtuemart (+ Joomla), Ubercart (+ Drupal), X-Cart , Zen Cart , ShopCMS , CS-Cart , Cube Cart , eCommerce Framework G5 (ECF), Ecommerce Templates , FlyingCart, Go Ecommerce EShop Builder , Interspire Shopping Cart , iScripts Multicart , JadaSite , JShop , LiteCommerce , PhPepperShop, PrestaShop, ProductCart , Ecommerce Shopping Cart Software , VP-ASP Shopping Cart , WebAsyst Shop-Script , Zeus Cart (AJ Shopping Cart).

Register Globals Emulator for PHP

If your webhosting turned register-globals off and you are still using a script/software which requires register-globals on you have a problem. But there is an easy solution: Just put this code at the top of your php script(s). Attention!!! "register_globals=on" means a huge security risk. Do not turn it on unless you know what are you doing!
Technorati Profile

foreach(array($_GET, $_POST, $_COOKIE) as $k=>$v){
	foreach($v as $k2=>$v2){
		$$k2 = $v2;
	}
}

Repair all mysql databases-tables with PHP

phpMyAdmin is a great tool but there is no option to repair all databases at once yet. Imagine you have no shell-access and need to repair all your 100 databases. It would take long time. This small PHP-Script lets you list, analyze and repair all your databases belong to same user at once.

If you already have shell access you can do it with mysqlcheck:

mysqlcheck -u root -p --auto-repair --check --optimize --all-databases


Repair with PHP:

  

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.

<?php 

/**
*	powered by @cafewebmaster.com
*	free for private use
*	please support us with donations
*/

function find_tld($url){

$purl  = parse_url($url);
$host  = $purl[host];

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?

  1. more security: hide file location
  2. shorter urls without file extensions like .html
  3. easy to remember / recommend urls
  4. search engine friendly

Image watermark with PHP

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.

  1. Create your mysql table
  2. Add top-code
  3. Add bottom-code

SQL Query

Smart Multi-Uploader and Thumbnail Creator from GIF/ JPEG/ PNG with PHP

Image uploader and thumbnail generatorThis 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!

<?php
Syndicate content

CafeWebmaster.com(CW) is a free online community for webdevelopers and beginners. Anybody can share their code, articles, tips, tutorials, code-examples or other webdesign related material on the site. Newbies can submit their questions and reply to existing questions. CW does not guarantee or warrant reliability of code, data and information published on the site. Use the site on your own risk. The site takes no responsibility of direct or indirect loss or any kind of harm to its users. The site also doesn't take responsibility of infected files or source code with any kind of infection or viruses, worms, spywares, malwares, trojan horses. CW reserves the right to edit, move, or delete any of content for any reason.