php

PHP: How To Create Copyright Watermark On Your Images

This is happen 3 days ago when my friend asking for converting him .htaccess into lighttpd rewrite rules format. After conversion done he wanted to share this script to everyone. If you’re professional Fotographer or just blogger, you may wanted to copyright all your photos/images. Even we know, sometimes people like to share for having fun…. but some people need a copyright to protected his original works before someone copy it. If you’re doing this manually it will take a long time and of course you will bored before this done. In short time we can make a simple watermark to protected our images.

Requirements:

  1. Apache with mod_rewrite / lighttpd (just convert rewrite rules, it should work)
  2. PHP with GD library (check in your phpconfig or asking your webhosting)

Step one.

Prepare one images that you should used as watermark.Â? This images should be in .PNG format, you can created one using photoshop software to make transparant effect.

Step two.

Make new or open your .htaccess files and write down this code inside it:

RewriteEngine On
RewriteRule ^(.+)\.jpg$ wrapper.php?image=$1\.jpg [L]
RewriteRule ^(.+)\.gif$ wrapper.php?image=$1\.gif [L]
RewriteRule ^(.+)\.png$ wrapper.php?image=$1\.png [L]
RewriteRule ^(.+)\.bmp$ wrapper.php?image=$1\.bmp [L]

For Lighttpd users try to using this conversion, if you meet any problem just following your path and symbol :

url.rewrite-once = (
“^\(.*).jpg” => “/wrapper.php?image=$1.jpg”,
“^\(.*).gif” => “/wrapper.php?image=$1.gif”,
“^\(.*).png” => “/wrapper.php?image=$1.png”,
“^\(.*).bmp” => “/wrapper.php?image=$1.bmp”
)

Step three.

Create wrapper.php files and put code below inside it:

<?php
$watermark = “watermark.png”;
$image = $_GET[“image”];

if (empty($image)) die();

if (!file_exists($image)) {
header(“404 Not Found”);
echo “File Not Found.”; die();
}
Read More »PHP: How To Create Copyright Watermark On Your Images

RELATED SEARCH TERMS:

How To: Created 2 Way SMS Gateway With NowSMS and PHP

I believe this topic is good for application developers. In this short article we will learn how to created SMS gateway and applied it on worldwide-web using PHP script. What is SMS? SMS stands for short message service. It’s the text communication service component of phone or mobile communication systems, using standardized communications protocols that allow the exchange of short text messages between fixed line or mobile phone devices… more details about SMS please read in wikipedia. I already written about how to build SMS gateway on my “Bahasa Indonesia” blog, but many people give negative comment on that article… Read More »How To: Created 2 Way SMS Gateway With NowSMS and PHP

PHP:Catching keyword from search engine

Good day everyone, In this article we will learn how to catch information from “HTTP_REFERER” function such as, referer info, keyword info, etc. From some search engine using PHP snippet. This script might usefully when you want to analyze your keyword and referer statistic. Last night I was searching in WP plugin for this script but I didn’t found one really good.

So let’s created it our self, First, You need this PHP class save it as searchkeys.class.php

<?php

class search_keywords
{
var $referer;

var $search_engine;

var $keys;

var $sep;

function search_keywords()
{
$this->referer = ”;
$this->sep = ”;

if ($_SERVER[‘HTTP_REFERER’] OR $_ENV[‘HTTP_REFERER’])
{
$this->referer = urldecode(($_SERVER[‘HTTP_REFERER’] ? $_SERVER[‘HTTP_REFERER’] : $_ENV[‘HTTP_REFERER’]));
$this->sep = (eregi(‘(\?q=|\?qt=|\?p=)’, $this->referer)) ? ‘\?’ : ‘\&’;
}
}

function get_keys()
{
if (!empty($this->referer))
{
if (eregi(‘www\.google’, $this->referer))
{
// Google
preg_match(“#{$this->sep}q=(.*?)\&#si”, $this->referer, $this->keys);
$this->search_engine = ‘Google’;
}
else if (eregi(‘(yahoo\.com|search\.yahoo)’, $this->referer))
{
// Yahoo
preg_match(“#{$this->sep}p=(.*?)\&#si”, $this->referer, $this->keys);
$this->search_engine = ‘Yahoo’;
}
else if (eregi(‘search\.msn’, $this->referer))
{
Read More »PHP:Catching keyword from search engine

RELATED SEARCH TERMS:

PHP:Creating Random Ads

Hello Everyone, I’m back again ho ho ho 😛 This time I will write tutorial on “how to make random ads” using php and text as database. This idea comes from gmail interface my lovely free mail account! pfffftt yea .. yea.. we all know gmail are better than ymail *lol* 😛 Alright leave them fight alone *not our business* before we start to make random ads we have to understand why we should make random ads? if we can fill those ads space with permanent ads. Most of people are bored about ads and ads on all website. Dilemma!… Read More »PHP:Creating Random Ads

Finally I Discover “Dude” Behind Steven George and Keyur Naik

Yay! I will catch this guy very soon! 😀 After talking with some of friends and using google search engine finally I discover real data behind “guy” using Steve George and Keyur Naik name here is scam information: IndoVCC Inc. Ray Surya ([email protected]) Jl. Magelang Km. 5 No. 8 Sleman Yogyakarta,55821 ID Tel. +062.87874876902 This guy have website on www.indovcc.com sale VCC to scam people and he’s buy all those VCC from me also scam me too. After look on he’s email I do whois also on www.sindotechno.net and found this information: owner-organization: Rapid Consulting & Services owner-fname: Hermawan owner-lname:… Read More »Finally I Discover “Dude” Behind Steven George and Keyur Naik

Make Money With Google Custom Search

Google adsense for search has been improved! for better result. Explanation about how it works basically just like code for search box and code for result box. By default minimum width for result box is 800 pixel so if you want to make result box fit in your website/blog you should have bigger frame area more than 800 pixel. Explanation about the result box is working like a frame.

It’s more better in search result because we can show the search result within our site page so we don’t loose more any visitor, when it open in new window or open in same window we lost our navigation site, The new version looks more professional and not annoyed anyone, useful! efficient! How to implemented it in your website/blog? Very simple if you familiar with html/php coding.Read More »Make Money With Google Custom Search

RELATED SEARCH TERMS:

SEO: URL Rewrite for 4images

Well, I just have done optimize SEO for one of my website using 4images gallery system it’s on basically I play with meta title, keywords, and description. And now I’m using URL rewrite. URL look cool and more search engine friendly I believe after a week or month it will indexed in lot of search engine 😀

Here is the way for you’re to using URL rewrite on 4images to make it more search engine friendly REMEMBER this will eat CPU resources. (before you doing this I recommended to backup your files first). Any alternative you can learn about URL rewrite yourself to make it works as you want (google is the best teacher).

1. You need to make .htaccess file and put this code on it

RewriteEngine On
RewriteRule ^lightbox\.html$ lightbox.php?%{QUERY_STRING}
RewriteRule ^lightbox\.([0-9]+)\.html$ lightbox.php?page=$1&%{QUERY_STRING}
RewriteRule ^search\.html$ search.php?%{QUERY_STRING}
RewriteRule ^search\.([0-9]+)\.html$ search.php?page=$1&%{QUERY_STRING}
RewriteRule ^postcard([a-zA-Z0-9]+)\.html$ postcards.php?postcard_id=$1&%{QUERY_STRING}
RewriteRule ^postcard\.img([0-9]+)\.html$ postcards.php?image_id=$1&%{QUERY_STRING}
RewriteRule ^k_(.*)_([0-9]+).html categories.php?cat_id=$2&%{QUERY_STRING}
RewriteRule ^r_(.*)_([0-9]+).html details.php?image_id=$2&%{QUERY_STRING}
RewriteRule ^r([0-9]+).search.html details.php?image_id=$1&%{QUERY_STRING}

2. Open /include/sessions.php before the last line add this code

//Mod_bmollet
/**
* Get the category url
* @param int $cat_id The id of the category
* @param string $cat_url The current status of the URL
*/
function get_category_url($cat_id,$cat_url = ”)
{
global $site_db;
$sql = “SELECT cat_name,cat_parent_id FROM “.CATEGORIES_TABLE.” WHERE cat_id = ‘”.$cat_id.”‘”;
$result = $site_db->query($sql);
$row = $site_db->fetch_array($result);
$row[‘cat_name’] = strtr($row[‘cat_name’], “ABCDEFGHIJKLMNOPQRSTUVWXYZ”,”eeeaeauoiaabcdefghijklmnopqrstuvwxyz”);
$cat_url = ‘_’.str_replace(‘+’,’_’,urlencode($row[‘cat_name’])).’_’.$cat_id.$cat_url;
// if you want full path of category in url, put next line in comment
return $cat_url;
if( $row[‘cat_parent_id’] != 0)
{
return get_category_url($row[‘cat_parent_id’],$cat_url);
}
else
{
return $cat_url;
}
}
//Mod_bmollet
/**
* Get the image url
* @param int $image_id The id of the image
*/
function get_image_url($image_id)
{
global $site_db;
$sql = “SELECT cat_id,image_name FROM “.IMAGES_TABLE.” WHERE image_id = ‘”.$image_id.”‘”;
$result = $site_db->query($sql);
$row = $site_db->fetch_array($result);
$row[‘image_name’] = strtr($row[‘image_name’], “ABCDEFGHIJKLMNOPQRSTUVWXYZ”,”eeeaeauoiaabcdefghijklmnopqrstuvwxyz”);
// if you want comlpete path to image in url, remove comment from following line
//return get_category_url($row[‘cat_id’]).’-‘.str_replace(‘+’,’-‘,urlencode($row[‘image_name’])).’-‘.$image_id;
return ‘_’.str_replace(‘+’,’_’,urlencode($row[‘image_name’])).’_’.$image_id;
}
Read More »SEO: URL Rewrite for 4images

RELATED SEARCH TERMS:

SEO Technique: Meta Title, Keywords, and description

GOOD SEO = Unstoppable Traffic = Money This one I forgot for almost a month to optimize my site traffic performance. Meta Title, Keywords, and Description should be optimized to get maximum indexed by search engine. Play it with simple code modification, If you have dynamic site this can be done in easy by just change some parameters to optimize all that meta. Example: Said you have a gaming site, By default all headers only optimized by fixed meta title, keyword, and description. I recommended you to change that fixed meta with dynamic meta. How? Simple! give it at least… Read More »SEO Technique: Meta Title, Keywords, and description

FREE: Classified Ads List

As my promise to my lovely readers, Here is my classified ads list.. You can use it to promote your website/blog and also use it to get backlink for your website/blog. Some sites on this list might not works, You should re-check it yourself or you can search new one using keywords “free classifieds” For faster and clean process I recommended you to use Roboform to fill the form and make one fake email address to prevent spam. This is my data from November 2007 : https://www.hindustanlink.com/ https://www.musicforte.com/ https://www.phpenabled.com/ https://www.voiceofafricaradio.com/ https://www.fsmisc.com/submit.php https://www.hallolondon.co.uk/ https://www.unclehenrys.com/ https://classifieds.christianpost.com/ https://bakersfield.pressmania.com/ https://www.indonesiaheadlines.com/ad/ https://dublin.campusanuncios.com/ https://www.classifieds.krify.com/ https://www.textileandappareltraders.com/Classifieds/ https://www.trailbreakers.com/… Read More »FREE: Classified Ads List

How To Stop WP-CRON.php From Using To Much CPU Usage

Three days ago arvixe telling my site using to much their cpu usage. They complaint about wp-cron.php and index.php process which I believe it was looping and won’t stop in background. wp-cron is just like cron job in normal condition. The crazy thing everyone doesn’t know is, it’s loading each time visitors coming to their site. I don’t know why wordpress don’t fix it or at least give options to run it each time frame. For a site using wordpress and have a lot articles/pages the optimization for it is just disable wp-cron, another option is disable wp-cron and running… Read More »How To Stop WP-CRON.php From Using To Much CPU Usage