Tuesday, August 23, 2011

Create install package

Go to start --> run

write iexpress.exe and press enter

I hope it helped. Feel free to comment...

Thursday, August 18, 2011

Upload big dump file to phpmyadmin

If you are getting the message below while importing a file in phpmyadmin, then you are at right place.


Follow the steps below to resolve the issue.

  1. Go to c:\xampp\phpmyadmin
  2. Create a new folder "upload" in this directory. Place the file you want to import in upload directory.
  3. Open the file c:\xampp\phpmyadmin\config.inc.php
  4. Add the following code at the end of this file.

  • Go to http://localhost/phpmyadmin/ --> import
  • You will see a drop down list just like below. Select the file you want to import from the list and click Go.














I hope it helped. Feel free to comment...

Thursday, May 19, 2011

Altering CSS Class Attributes with JavaScript


This JavaScript function will dynamically change the style information for any CSS class in a Web Page. Applying this function to a class will cause all items calling on the class to change to the updated style value. This function works even if there are multiple stylesheets referenced in the document.
Function Name: changecss(theClass,element,value)
To use this function, copy this link and place it in the head of your HTML before any other JavaScript that may use it.
<script type="text/javascript" src="http://www.shawnolson.net/scripts/public_smo_scripts.js"></script>

Please include credit when using this script and read this site's Terms & Conditions before using.
This function was last updated on October 9, 2010. It has been tested and works in the following browsers:
  • Internet Explorer 6+ (Windows)
  • Firefox 3+ (Windows & Linux)
  • Google Chrome 2.0.172.33 + (Windows)
  • Safari 3.1.1 + (Windows)
  • Opera 9.64 +(Windows)
Note that I have tested these browsers on Windows; this function works in Firefox in Linux as well. I assume that the latest Mac versions work the same.


function changecss(theClass,element,value) {
    //Last Updated on October 10, 1020
    //documentation for this script at
    //http://www.shawnolson.net/a/503/altering-css-class-attributes-with-javascript.html
     var cssRules;

     var added = false;
     for (var S = 0; S < document.styleSheets.length; S++){

    if (document.styleSheets[S]['rules']) {
      cssRules = 'rules';
     } else if (document.styleSheets[S]['cssRules']) {
      cssRules = 'cssRules';
     } else {
      //no rules found... browser unknown
     }

      for (var R = 0; R < document.styleSheets[S][cssRules].length; R++) {
       if (document.styleSheets[S][cssRules][R].selectorText == theClass) {
        if(document.styleSheets[S][cssRules][R].style[element]){
        document.styleSheets[S][cssRules][R].style[element] = value;
        added=true;
        break;
        }
       }
      }
      if(!added){
      try{
          document.styleSheets[S].insertRule(theClass+' { '+element+': '+value+'; }',document.styleSheets[S][cssRules].length);

      } catch(err){
              try{document.styleSheets[S].addRule(theClass,element+': '+value+';');}catch(err){}

      }

      //if(document.styleSheets[S].insertRule){
              //document.styleSheets[S].insertRule(theClass+' { '+element+': '+value+'; }',document.styleSheets[S][cssRules].length);
            //} else if (document.styleSheets[S].addRule) {
                //document.styleSheets[S].addRule(theClass,element+': '+value+';');
            //}
      }
     }
    }
I hope it helped. Feel free to comment...

Tuesday, April 12, 2011

Tuesday, April 5, 2011

SEO - Search Engine Optimization

To implement SEO - Search Engine Optimization correctly, we must broke it down into 2 factors;
  • on-page criteria: <title>,<meta-description>,<h1>,<h2>,...,<h6>,<b>,<i>, keyword proximity, keyword density and relevance, etc...
  • off-page criteria: links (in pages within our website and pages of other websites) that point to our specific pages. The terms "Page Rank" is used to weight and evaluate off-page criteria. Special attention should be given to: anchor text, reference_tags, "title" attribute and "target_"

I hope it helped. Feel free to comment...

Reference
http://www.wepapers.com/Papers/96414/Seo_Tutorial.pdf

URL shortener - Convert long URL into short URL


When it comes to URL shorteners, fewer letters are always best. x.co is one of the shortest, publicly-accessible shortening applications around.
Go ahead to x.co, just copy and paste a long URL into the box, then use the neat little URL we provide in your Twitter or Facebook posts, comments, emails, blog posts - wherever you like.



I hope it helped. Feel free to comment...

Friday, April 1, 2011

Create thumbnails of jpeg, gif, png images using PHP script

<?php
/*------------------------------------------------------------*/
//Author: Raju Rajpurohit
//Purpose: Function create the absobulate image (thumb image)

//$image = name of the original image
//$new_image_name = new name of image
//$width = width of image as you required
//$height = height of image as you required
//$fs_path = path where the file will be saved or located the original file
/*------------------------------------------------------------*/
define("JPEGQUALITY", 95);
function create_abs_image($image, $new_image_name, $width, $height, $fs_path, $aspectratio=1, $resize=1)
{
$src = $fs_path . $image;
if($imagedata = @getimagesize($src))
{
define(JPEGQUALITY, 95);//define the quality of JPG thumbnails
error_reporting(0);

$types = array (1 => "gif", "jpeg", "png", "swf", "psd", "wbmp");
$not_supported_formats = array("PSD");//write ext in capital letter
umask(0);

if(!$imagedata[2] || $imagedata[2] == 4 || $imagedata[2] == 5){
die('The specified file is not a picture!');
}

$imgtype = "!(ImageTypes() & IMG_" . strtoupper($types[$imagedata[2]]) . ")";

if((eval($imgtype)) || (in_array(strtoupper(array_pop(explode('.', basename($src)))),$not_supported_formats))) {
$src = substr ($src, (strrpos ($fs_path . '/', '/'))+1);
return $src;
}

if(!isset ($width)) $width = floor ($height * $imagedata[0] / $imagedata[1]);
if(!isset ($height)) $height = floor ($width * $imagedata[1] / $imagedata[0]);

if ($aspectratio && isset ($width) && isset ($height))
{
if ((($imagedata[1]/$height) > ($imagedata[0]/$width) ))
{
$width = ceil(($imagedata[0]/$imagedata[1])* $height);
} else {
$height = ceil($width/($imagedata[0]/$imagedata[1]));
}
}

$thumbfile = basename($new_image_name);

$calc_x = ($imagedata[0] < $width ? $imagedata[0] : $width);
$calc_y = ($imagedata[1] < $height ? $imagedata[1] : $height);


if(($imagedata[0] > $width || $imagedata[1] > $height) || (($imagedata[0] < $width || $imagedata[1] < $height) && $resize))
{
$makethumb = true;
}else{
$makethumb = false;
}

$width = $calc_x;
$height = $calc_y;

if ($makethumb)
{
$image = call_user_func("imagecreatefrom" . $types[$imagedata[2]], $src);

if(function_exists("imagecreatetruecolor") && ($thumb = imagecreatetruecolor($width, $height))){
imagecopyresampled($thumb, $image, 0, 0, 0, 0, $width, $height, $imagedata[0], $imagedata[1]);
}else{
$thumb = imagecreate ($width, $height);
imagecopyresized ($thumb, $image, 0, 0, 0, 0, $width, $height, $imagedata[0], $imagedata[1]);
}

if ($types[$imagedata[2]] == "jpeg"){
call_user_func("image".$types[$imagedata[2]], $thumb, $fs_path.$thumbfile, JPEGQUALITY);
}else{
call_user_func("image".$types[$imagedata[2]], $thumb, $fs_path.$thumbfile);
}

imagedestroy ($image);
imagedestroy ($thumb);
}
}
}
$fs_root =  $_SERVER['DOCUMENT_ROOT'] . '/';
create_abs_image('original_image.jpg', 'thumb.jpg', 50, 50, $fs_root);
?> 

Copy paste the above code in a new php file and save the file in the www directory ( or htdocs for xampp).
Place the original picture in the same www or htdocs directory and replace original_image.jpg with the name of the original picture.
Now go to browser and run
http://localhost/filename.php

A new file thumb.jpg should be created in the www or htdocs directory.

I hope it helped... Please feel free to comment