Thursday, October 20, 2011

Introduction to Website Login with Google, Yahoo

When we are working with Website Account Registration / Account Login Page, We have to present a Signup form based on our website requirement. In case we are provide a simple signup form with Email, password, Confirm password. In this case we can use External website Login from OAuth Providers among most familiar  services among web. Such this think , Google, Yahoo, Facebook, Twitter all major services are provide OAuth to accept web developer/Website owners are use their credential to accept users on their websites.

Let us create a Login Page for our website to accept the visitors those who already have a account with Google or yahoo.

Let us Create Website login with Google account or Yahoo Account

Website Login with Google Account, Yahoo Account with Oauth

Website registration and Login forms have important aspect of our development process. Currently visitors were not interested to fill large forms in any website. In this case visitors are not willing to join by signup on our website. In this aspect, technology will a solution. that is open social login from other major services. By this way, we can be use Login from google, yahoo, facebook, twitter.

First, Let us create a open login for our website login or registration form with Google Account and Yahoo Mail. upcoming days we will see other services. Now we can create website Login with OpenID OAuth Login with Google Accounts and Yahoo Accounts.

let us create How to make people login into your website with their Google account and Yahoo
Google and Yahoo provides Federated Login for Account Users with OAuth.

Step: 1
Download LightOpenID Class from

Step: 2: Write a Following Code and design a Form to Handle Login

<?php session_start();
# Logging in with Google accounts requires setting special identity, so this example shows how to do it.
require 'require/openid.php';

try {
    # Change 'localhost' to your domain name.
    $openid = new LightOpenID('');
  $openid->required = array(

    if(!$openid->mode) {
        $openid->identity = '';
        header('Location: ' . $openid->authUrl());
  $openid->identity ='';

    } elseif($openid->mode == 'cancel') {
        echo 'User has canceled authentication!';
    } else {
   $_SESSION['name']=$external_login['namePerson/first']." ".$external_login['namePerson/last'];
} catch(ErrorException $e) {
    echo $e->getMessage();

Download This Script     Live Demo     Download Script

Monday, October 10, 2011

HTML code for an image

Embedded HTML Code for an Image is an advanced technique for Modern Web. Standard HTML Images are map with <IMG> tag using src attribute src attribute is to be an URL of an Image.

Traditional Image Tag Example:
<img src="pathof-image.jpg" />

HTML code for an image
In Modern Image tag  Image Soruce Placed It self with in the SRC using Image Tag Data URI Scheme

Click Here to View how to create  Image Tag Data URI Scheme

Following PHP Function we can build the HTML Code for an Image.

// Funtion to prepare Data URI:
// @ parm: Image filepath, Image Size
// reutn : data_uri string
function thumbnail_data_uri($filename,$width=0,$height=0) 
 // Get Image Header Type
      $image_info = getimagesize($filename);
      $image_type = $image_info[2];

 // Check the Size is Specified
 if($width!=0 and $height!=0)
      if( $image_type == IMAGETYPE_JPEG ) {
         $image = imagecreatefromjpeg($filename);
      } elseif( $image_type == IMAGETYPE_GIF ) {
         $image = imagecreatefromgif($filename);
      } elseif( $image_type == IMAGETYPE_PNG ) {
         $image = imagecreatefrompng($filename);
   imagealphablending($image, true);


 $new_image = imagecreatetruecolor($width, $height);
 imagealphablending($new_image, false);
 imagesavealpha($new_image, true);     
      imagecopyresampled($new_image, $image, 0, 0, 0, 0, $width, $height, imagesx($image),imagesy($image));
      $image = $new_image; 
      if( $image_type == IMAGETYPE_JPEG ) {
      } elseif( $image_type == IMAGETYPE_GIF ) {
      } elseif( $image_type == IMAGETYPE_PNG ) {
 $base64 = base64_encode($content); 
 return "data:$image_type;base64,$base64";


Simple captcha with PHP

Simple captcha with PHP, We seen how to create a Simple captcha . Now we look how to integrate that simple Captcha with HTML Form. Now I am going to show you a Newsletter Subscriber with our Simple Captcha.

Simple captcha with PHP and Live Example with Newsletter
  • Show an image Captcha without any dependancies, such as Class, Function etc.,
  • Customizable code length, character sets, and Unicode support
  • TTF font support
  • Easily  customization: Background and Foreground colors
Kindly view  How to Create a Simple Captcha in PHP before the Newsletter Integration of this Capcha

Let me create a HTML form look like this

Saturday, October 8, 2011

Google PageRank Script New Updated toolbar query url

Due to the problem on PR Finding script. When we identify the problem of this script, I have found that query URL been changed by Google which we fetch PR problematically. Here is the updated Google PageRank Script New Updated toolbar query URL

The Old URL Was This -