Reiciendis voluptatibus...

At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti...

Reiciendis voluptatibus maiores

Asumenda omnis dolor...

At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti...

Asumenda omnis dolor

Voluptates repudiandae ...

At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti...

Voluptates repudiandae sint

Necessitatibus saepe ev...

At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti...

Necessitatibus saepe eveniet

Omnis dolor repellendus...

At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti...

Omnis dolor repellendus

Pomnis voluptas assumen...

At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti...

Pomnis voluptas assumenda

Harum quidem rerum...

At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti...

Harum quidem rerum
  • Reiciendis voluptatibus maiores
  • Asumenda omnis dolor
  • Voluptates repudiandae sint
  • Necessitatibus saepe eveniet
  • Omnis dolor repellendus
  • Pomnis voluptas assumenda
  • Harum quidem rerum

Thursday, December 15, 2011

Web Design Trend to incorporate in 2012


Web Design Trend to incorporate in 2012


It’s this time of year again. Some web design trends to incorporate in 2012.

A design is no longer limited by coding languages. Web Designer can be more innovative and use less angular elements; you will see a lot more different web design trend in the coming year. Some of them are:

1. Web design for experience user: 
The Panda releases from Google in 2011 have put all web designers and SEO’s on alert that Google is now evaluating web user experience from a human perspective. This is a major element that will evolve over time in their search result algorithms. So a business’ web design should be well-organized, easy-to-navigate, “feel trustworthy and reliable,” and be presented as a source of “expertise” and “knowledge.” Human traits are now important in web design and user experience. Design for users first, search engines second.

2. Web development without flash: 
Now  Android, RIM tablets and iPhone based application does not  use flash anymore. Thus the original Flash will die finally. Adobe is already working on a HTML5 implementation instead. So Flash will be probably resurrected based on Web Standards. Now Web designer concentrate more on concise Mobile web design, make it creative, and built for the mobile user experience.

3.   SEO in 2012:
SEO isn’t departed in 2012, but it’s more and more part of larger ideas and concepts.  The new trends in SEO are content marketing, inbound marketing, digital marketing or Internet/online marketing (again). SEO practitioners do just stuff Meta tags, but their tasks now encompass much more.

4.    Social media Pages:
The creative web design that is created by Web Designer for a main HTML website or CSS should be extended to the social media pages. Facebook, Twitter, Blogger, WordPress, and YouTube should each have the effective web design elements from the main website. Social media continues to grow with acceptance on all levels of audiences. And social media is blending closer with your Internet marketing tactics as the search engines begin to integrate social media into search results. Social media and HTML web design will grow closer and closer together as 2012 unfolds.

This information is gathered by some renowned and experienced blogger.
Posted by c.sadeesh kumar 3 comments

Wednesday, December 14, 2011

WordPress - Advantages in New WordPress 3.3


Advantages in New WordPress 3.3


WordPress 3.3 has been released. The world’s most popular CMS and blogging tool has been tidied and polished further to make web publishing even easier. It’s been downloaded 65 million times since v3.0 was released and is estimated to run 15% of all websites (or 22% of all new websites).

Existing users can upgrade with single click. I’ve rarely experienced problems doing that but it still makes me nervous. Back-up your files and database before proceeding.

Let’s see what goodies WordPress 3.3 has to offer…

Revamped Interface

HTML5 responsive design techniques have been implemented to help WordPress work on small-screen devices such as tablets. As you reduce the screen size, features such as the side menu automatically collapse.

If you suffer from aching fingers, v3.3's new flyout sub-menus make it possible to access any administrative screen with a single click.



The (previously optional) admin bar and the header have been combined into a single toolbar. It saves space, is less obtrusive and provides quick access to help, comments quick add links and your profile. That said, I suspect it may cause compatibility issues with some plug-ins — it’s definitely a feature you should test before going live.

Finally, WordPress helps you discover new features with pointers which appear the first time you see them:


Drag and Drop Media Upload

Assuming you’ve got a decent HTML5 browser, you’ll never need to use the clunky “browse files” dialog again. One or more images or other media can be dragged into the media upload box.

In addition, there’s now a single upload panel for all media — no matter what file types you want to add. WordPress also supports RAR and 7z archive formats.

New Tumblr Importer

WordPress can now import content directly from Tumblr. Tumblog posts can be converted to a matching WordPress post format.

Better Co-operation

If you’ve ever received the “Warning: Bob is currently editing this post” message, you’ll be pleased to hear that co-editing activity lags should be a thing of the past.

There’s More…

Version 3.3 also offers:

  • a new dashboard welcome screen for fresh installations
  • a new post-update changelog screen
  • more flexible and faster permalinks
  • an overhaul of the editor API
  • a new WP_Screen API for working with admin panels
  • a new is_main_query() for determining whether you’re in the main loop


Time to Upgrade?

Few people will experience problems but they inevitably crop up with new software releases. If the whole of your business depends on WordPress, it might be advisable to let others find the issues and wait for version 3.3.1. If past experience is anything to go by, that’ll be available within a few weeks.

Have you upgraded to WordPress 3.3? Is it the best version ever or has your installation exploded?

Download WordPress 3.3 from wordpress.org/download
Posted by c.sadeesh kumar 0 comments

Parse XML With PHP : Read XML File From URL


Parse XML With PHP : Read XML File From URL

You can build really cool apps with API’s and most sites will send either JSON or XML back to your app, I prefer JSON actually but some of these API’s will only send XML and, while you can always convert XML to JSON, it’s always better to save that processing time.

The Function: simplexml_load_file
Since version 5, PHP comes with this easy to use function called “simplexml_load_file” , the function requires only one parameter, the URL, but has other optional ones. The URL can be relative for files in the same server where the script is running, or absolute for external.

The XML File (data) “xml-file.xml”
Let’s begin by creating an XML file called “xml-file.xml” with the following contents.

<?xml version="1.0" encoding="UTF-8"?>
<library>
<book>
<title>PHP and MySQL</title>
<author>Miguel Alvarez</author>
<publisher>WebHole</publisher>
<price>1.99</price>
</book>
<book>
<title>JAVA 123</title>
<author>WIlliam Vega</author>
<publisher>WebHole</publisher>
<price>2.99</price>
</book>
</library>

As might guess this file could come from a library’s database ( those books are fake by the way  ). So as you can see we have two books in this xml library file and inside each “<book>”  tag there is information about each particular book.


The PHP File (parser) “parser.php”
Now make a file and call it “parser.php”, make sure that both file are in the same folder for the purposes of this tutorial.

Let’s begin this script by create a varible with the path and file name of the XML file you want to parse

<?php
$url = 'xml-file.xml';

This is where the fun begins. Create a variable $xml. We will then use simplexml_load_file($url); to load the file into the variable.

<?php
$url = 'xml-file.xml';
$xml = simplexml_load_file($url);

Now $xml has the contents of “xml-file.xml” loaded into an array-like structure that it’s easy to learn if you know arrays.

Think of the variable $xml as if it was the <library> tag in our xml file.

Let’s us then show the title of the first book in our xml file, that is, the first <book> tag from the top.

// get first book title
$title=$xml->book[0]->title;
// show title
echo $title;

That was easy right? You can see that, like in arrays, to get the first book you actually begin with a zero, then, to get the title of the second book you would simply replace that zero with a one, like this.

// get second book title
$title=$xml->book[1]->title;
// show title
echo $title;

Do I have to tell you that to get the price of the first book you would use $title=$xml->book[1]->price; like this?

// get price of first book
$price=$xml->book[0]->price;
// show price
echo $price;

You actually don’t need to use “[0]” if you know you are referring to the first. So the following two lines do the same thing.

$title=$xml->book[0]->title;
$title=$xml->book->title;

Okay so now let’s take a look at the whole php file.

<?php
$url = 'xml-file.xml';
$xml = simplexml_load_file($url);

// get first book title
$title=$xml->book[0]->title;
// show title
echo $title;
echo '<br/>';
// get second book title
$title=$xml->book[1]->title;
// show title
echo $title;
echo '<br/>';

// get first book title again
$title=$xml->book->title;
// display title
echo $title;
?>


You have probably, and if not you will, encounter XML with attributes and you’ll want to read those as well, you are also probably wondering how you could loop through 100 books, I don’t know about you but I like to read and write short tutorials so am going to let you play with what you learned today and talk about these two topics on part 2, c u later.

Source
http://webhole.net/2009/07/25/how-to-parse-xml-with-php-part-one/

Posted by c.sadeesh kumar 0 comments

Monday, September 12, 2011

Setting Age Limit and Date Of Birth Validation In jQuery


The following function will take an input of day, month and year. It will then take these values and create a new date object when compared to the current date we can work out the age of the visitor.

If there is a age limit and the visitors age is not more than the age limit we can then disallow entry.

  $("#form").submit(function(){
      var day = $("#day").val();
      var month = $("#month").val();
      var year = $("#year").val();
      var age = 18;
      var mydate = new Date();
      mydate.setFullYear(year, month-1, day);

      var currdate = new Date();
      currdate.setFullYear(currdate.getFullYear() - age);
      if ((currdate - mydate) < 0){
          alert("Sorry, only persons over the age of " + age + " may enter this site");
          return false;
      }
      return true;
  });

Posted by c.sadeesh kumar 1 comments

Wednesday, August 31, 2011

Server bandwidth saving using .htaccess in Php


Today I am sharing the most effective and usefull trick to save server bandwidth.

This trick is useful for who are paying for their server bandwidth.

Put below code in your .htaccess and done.

All it does is enables PHP’s built-in transparent zlib compression.

    <ifModule mod_php4.c>
     php_value zlib.output_compression 16386
    </ifModule>

This will half your bandwidth usage in one stroke, more than that,

In fact. Of course it only works with data being output by the PHP module, but if you design your pages with this in mind,

you can use php echo statements, or better yet, php “includes” for your plain html output and just compress everything!

Remember, if you run phpsuexec, you’ll need to put php directives in a local php.ini file, not .htaccess.
Posted by c.sadeesh kumar 1 comments

Why SEO (Search Engine Optimization) important for your website?


          Today we will be discussing some important facts about SEO and its usefulness for your website. Before moving ahead, I would like to define SEO.
 
SEO stands for “Search Engine Optimization”. SEO can create content of your web pages more relevant, more interesting and easily read by search engines crawling and indexing. Basically SEO is a summation of all those practices and techniques which could help you in getting higher rankings for your website in search engines.


SEO- Search Engine Optimization
Why would SEO be of great significance to you? Would it be possible for you to survive if your customers/ clients are unable to find your business address or contact number? According to me the answer to this would be “NO”.

SEO is very important for any website, be it an information site or an online store. Now if anyone wants some kind of information or wants to buy something, he first searches on internet. Every website owner aims that his website should reach first to the visitors. Now the question arises how? The answer to this question would be “SEO- Search Engine Optimization”.

SEO is a technique which would increase your traffic, increase your rankings and consequently boost up your business. If SEO is not done for your website, people may not have been even aware that your website exists. If you say, you have a beautiful website and this will generate traffic for you, then this is your misconception.

It is SEO which would present your website in an effective way to potential visitors. SEO can be done in 2 ways: On Page SEO and Off Page SEO

SEO Process
There are different techniques in both the types. In case you are not familiar with these services, then you can take some Professional SEO Services for your website. 
Posted by c.sadeesh kumar 7 comments

jQuery - Adding Sound Effect to the Tag


Adding sound effect to A tag with jQuery

This trick is pretty simple and effective. It appends a hidden embed tag to the link which play the sound once only. These examples come with click and hover events.


JS - jQuery

   $(function(){
       $('a.click').click(function(){
           $('embed').remove();
           $('body').append('<embed src="click.wav" autostart="true" hidden="true" loop="false">');
       });

       $('a.hover').mouseover(function(){
           $('embed').remove();
           $('body').append('<embed src="hover.wav" autostart="true" hidden="true" loop="false">');
       });
   });

HTML/XHTML

   <p><a href="#" class="click">Click here for sound effect</a></p>
   <p><a href="#" class="hover">Hover here for sound effect</a></p>


Posted by c.sadeesh kumar 1 comments

Monday, August 29, 2011

Create Tiny URL Link With PHP Function

 

Create Tiny URL Link With PHP Function

Tiny URL site allows you to compress the size of your URLs which is mostly used on the social networking site twitter, because of the limited characters you can use.

But to use the tiny URL feature you have to go there website and fill out a form to get your tiny URL.

With this function you can return the output of the tiny URL to be used anywhere on your site quickly and easily.


function getTinyUrl($url) {
    return file_get_contents("http://tinyurl.com/api-create.php?url=".$url);
}
Posted by c.sadeesh kumar 0 comments

PHP Password Generator Snippet

Get stuck trying to pick a new password each time you signup to a new service or website. Most people do use the same password on every site that they go to but this can be dangerous if 1 site gets hacked then your password could be used on all the sites you regularly use.

Therefore for best security reason you should use a different password for different websites and there are many password management tools out there that can help you remember all your passwords.

So if you are having to think up new passwords each time you sign up to a website you might run out of ideas of what to put and start creating just anything. But some websites have password strength requirements, such as it has to have at least one number, or one capital letter.

Password Strength

 

The below php snippet will generate a password for you and you can customise it to a certain level of password strength.

If the strength is more than 1 then capitals are included.

If the strength is more than 2 then capital vowels are included.

If the strength is more than 4 then numbers are included.

Finally if the strength is more than 8 then special characters are included.

I find that a password strength of more then 4 is good enough for most websites.


function generatePassword($length=9, $strength=0) {
    $vowels = 'aeuy';
    $consonants = 'bdghjmnpqrstvz';
    if ($strength >= 1) {
        $consonants .= 'BDGHJLMNPQRSTVWXZ';
    }
    if ($strength >= 2) {
        $vowels .= "AEUY";
    }
    if ($strength >= 4) {
        $consonants .= '23456789';
    }
    if ($strength >= 8 ) {
        $vowels .= '@#$%';
    }
    $password = '';
    $alt = time() % 2;
    for ($i = 0; $i < $length; $i++) {
        if ($alt == 1) {
            $password .= $consonants[(rand() % strlen($consonants))];
            $alt = 0;
        } else {
            $password .= $vowels[(rand() % strlen($vowels))];
            $alt = 1;
        }
    }
    return $password;
}
Posted by c.sadeesh kumar 0 comments

Smart File Type Detection Using PHP

In most web applications today, there is a need to allow users to upload images, audio and video files. Sometimes, we also need to restrict certain types of files from being uploaded – an executable file being an obvious example. 

Security aside, one might also want to prevent users from misusing the upload facility, e.g. uploading copyrighted music files illegally and using the service to promote piracy! In this article, we’ll look into a few ways in which we can achieve this.

File type detection using extension and MIME types

I am not going to talk about this in too much detail as after all, this is what we normally do when we want to restrict certain files. We simply get the MIME type of the file using $_FILES['myFile']['type'] and check if it’s of a valid type.

Or we might scan the last few characters of the file name and reject files ending with a certain extension. Unfortunately, these methods are hardly sufficient, as one can easily change the extension of a file to bypass this restriction. Furthermore, MIME type information is given by the browser and most browsers, if not all, determine the mime type based upon the file’s extension! Hence MIME types can be pretty easily spoofed too.

Let’s now explore some others ways which offer better fool-proofness.

Using Magic Bytes

 The best way to determine the file type is by examining the first few bytes of a file – referred to as “magic bytes”. Magic bytes are essentially signatures that vary in length between 2 to 40 bytes in the file headers, or at the end of a file. There are several hundred types of files, and quite a few of them have several file signatures associated with them. You can see a list of file signatures over here.

Although inconsistent, this is our best bet in detecting file types reliably. This seemingly difficult task has been made really easy by a PECL extension called Fileinfo. As of PHP 5.3, Fileinfo is shipped with the main distribution and is enabled by default, so this is definitely a robust and simple way to detect and impose restrictions on the types of files uploaded.

Let’s now see how we can detect a file type using Fileinfo:

// in PHP 4, we can do:
$fhandle = finfo_open(FILEINFO_MIME);
$mime_type = finfo_file($fhandle,$file); // e.g. gives "image/jpeg" 
 
// in PHP 5, we can do:
 
$file_info = new finfo(FILEINFO_MIME);	// object oriented approach!
$mime_type = $file_info->buffer(file_get_contents($file));  // e.g. gives "image/jpeg"
 
switch($mime_type) {
	case "image/jpeg":
		// your actions go here...
}

Handling image uploads

 If you intend to allow only image uploads, then you can use the inbuilt getimagesize() function to ensure that the user is actually uploading a valid image file. This functions returns false, if the file is not a valid image file.

//  Let's assume that the name attribute of the file input field you have used 
is "myfile"
 
$tempFile =  $_FILES['myFile']['tmp_name'];  // path of the temp file created by 
                                               //PHP during upload
$imginfo_array = getimagesize($tempFile);   // returns a false if not a valid image 
                                              //file
 
if ($imginfo_array !== false) {
    $mime_type = $imginfo_array['mime'];
    switch($mime_type) { 
 
	case "image/jpeg":
		// your actions go here...
 
    }
}
else {
    echo "This is not a valid image file";
}

Reading and interpreting magic bytes manually

If for some reason, you are not able to install Fileinfo, then you can still manually determine the file type by reading the first few bytes of a file and comparing them with known magic bytes associated with the particular file type. This process definitely has an element of trial and error, because there is still a chance that there are a few undocumented magic bytes associated with legitimate file formats. As a result, valid files could be rejected by your system. However it’s not impossible as a couple of years back, I was asked to work on a script that allowed only genuine mp3 files to be uploaded, and since we could not use Fileinfo, we resorted to this manual scanning. It took me a while to account for some of the undocumented magic bytes for mp3, but pretty soon, I got a stable upload script running.

Before I end, I would just like to part with a general word of caution: Make sure that you never call an include() with a file that was uploaded, as PHP code can very well be hidden as part of the picture, and the picture would pass your tests for file validation just fine, only to cause havoc when executed by the server.

If you intend to allow only image uploads, then you can use the inbuilt getimagesize() function to ensure that the user is actually uploading a valid image file. This functions returns false, if the file is not a valid image file.
Posted by c.sadeesh kumar 2 comments