Friday, July 4, 2014

Free Responsive HTML5 Templates

Free Responsive HTML5 Templates

Features

1.Fully Responsive and look great on smartphones, tablets, PCs.
2.Developed on HTML5 and CSS3
3.Easy Customizable
4.100% Free templates

Click here to download free templates

Please share your comments and feedback.Thanks.Please subscribe my updates via email.

Disable submit button until form fields are filled using jQuery

In this post i want to explain how to Disable submit button until form fields are filled using jQuery.This jQuery is used to check all form fields are filled are not.If fields are not filled returns false,otherwise return true.keyup() function is used to in this example.


Before that we need to include jQuery Library file.Copy and Paste the following URL.
Library File: <script type="text/javascript" src="http://code.jquery.com/jquery-1.5.js"></script>


jQuery Function

      <script type="text/javascript">
    (function() {
    $('form > input,textarea').keyup(function() {
        var empty = false;
        $('form > input,textarea').each(function() { //Check form fields are empty or filled
            if ($(this).val() == '') {
                empty = true; //result
            }
        });
        if (empty) {
            $('#send').attr('disabled', 'disabled');
        } else {
            $('#send').removeAttr('disabled');//remove disabled
        }
    });
})()
</script>

HTML File

    <form name="register" action="#" method="post">
      <table width="400" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td>Username</td>
          <td><input type="text" id="user_input" name="username" /></td>
        </tr>
        <tr>
          <td>Password</td>
          <td><input type="password" name="password" /></td>
        </tr>
        <tr>
          <td>Email</td>
          <td><input type="text" name="email" /></td>
        </tr>
        <tr>
          <td> Message</td>
          <td><textarea name="message"></textarea></td>
        </tr>
      </table>
      <input type="submit" id="send" value="Send" disabled="disabled" />
    </form>

Please share your comments and feedback.Thanks.Please subscribe my updates via email.

Thursday, July 3, 2014

Live preview using jQuery

In this post i want to explain Live preview with jQuery.This is very simple jQuery function.the keyup() is used to this example.

Syntax

$(selector).keyup()

Before that we need to include jQuery Library file.Copy and Paste the following URL.
Library File:
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.0/jquery.min.js"></script>

jQuery Function

 <script type="text/javascript">
        $(function()
        {
            $(".url").keyup(function()
            {
                $(".url_preview").text($(this).val()); //Get typed values and display values
            });
    });
</script>

the text() function will change the (text) value of the specified element, but keep the html structure.

HTML File

 <input type="text" name="url"  class="url" />
          <span class="url_preview" style="color:#0099FF"></span>

Please share your comments and feedback.Thanks.Please subscribe my updates via email.

Saturday, June 28, 2014

Top 5 websites for fonts

1.Google Web fonts

Google Fonts directory is contains all free fonts.Google web fonts is contains source code of all free fonts.Google Fonts makes it quick and easy for everyone to use web fonts, including professional designers and developers

To download google fonts click here.



2.Free typography

Freetypography is best blog for free bset web fonts for websites.


To download fonts from http://freetypography.com/ Click Here

3.Openfontlibrary

http://openfontlibrary.org/ is contains open source fonts and it allows users dowload fonts and Upload fonts in website


To download fonts from http://openfontlibrary.org/Click Here

4.Fontspring

http://fontspring.com/ is contains best web fonts and it allows users download fonts.


To download fonts from http://fontspring.com/Click Here

5.Fontsquirrel

http://www.fontsquirrel.com/ is contains bestfree  web fonts and it allows users download fonts.


To download fonts from http://www.fontsquirrel.com/Click Here

Monday, June 23, 2014

Wordpress,Joomla and Drupal Comparsion

Today We will discuss about Most popular CMS tools.If you know about any CMS tools please comment here.

Most popular CMS tools are
  1. Wordpress
  2. Joomla
  3. Drupal


Wordpress:

Wordpress is most popular CMS tool,Is used to create powerful websites and blogs.There are many plugins,themes available in web.

It is open source  tool and we can easily develop websites and blogs.

To develop website in Wordpress Click Here.

Joomla:

Joomla is also Very powerful CMS tool .It is also used to develop web applications and blogs.The latest version of joomla is 3.2.It is have many features like Content Versioning,Rapid framework,Joomla Appstore etc.

Compare to Wordpress, Joomla is little difficult to develop web applications. And Have separate admin section.

To develop website using joomla Click Here

Drupal:

 Drupal is open source CMS tool is used to create web applications.It is diffcult compare to wordpress and Joomla.

Drupal don't have separate admins section.Admin was built in front end.

Wordpress VS Joomla Vs Drupal:

Features Comparison:



Please feel free to comment and don't forget to subscribe my updates via email.

Sunday, June 22, 2014

CSV to Mysql import in PHP

Today i am going to explain how to import values form CSV to Mysql database.It is very useful to import bulk amount data's very easily.

Let's have look.



Step 1: You need a database connection

db.php

     <?php
        define ("DB_HOST", "localhost"); // set database host
        define ("DB_USER", "root"); // set database user
        define ("DB_PASS",""); // set database password
        define ("DB_NAME","db"); // set database name
      
        $link = mysql_connect(DB_HOST, DB_USER, DB_PASS) or die("Couldn't make connection.");
        $db = mysql_select_db(DB_NAME, $link) or die("Couldn't select database");
    ?>
 
Create a database and import the following sql query.

users.sql

CREATE TABLE IF NOT EXISTS `student` (
  `id` int(5) NOT NULL AUTO_INCREMENT,
  `name` varchar(200) NOT NULL,
  `email` varchar(200) NOT NULL,
  `city` varchar(200) NOT NULL,
  `image` blob NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

Used functions and Definition:

is_file() — Checks wheather the specified file is a regular file.
fopen - Used to open a file or url.
fgetcsv — Gets line from file pointer and parse for CSV fields

csv.php

      <?php
    if (isset($_POST['csvimport']))
{
  $csv_file = $_FILES['csvfile']['tmp_name'];

  if (!is_file($csv_file))
    exit('File not found.');

  $sql = '';

  if (($handle = fopen( $csv_file, "r")) !== FALSE)
  {
      while (($data = fgetcsv($handle, 1000, ",")) !== FALSE)
      {
          $sql .= mysql_query("INSERT INTO `users` SET
            `id` = '$data[0]',
            `name` = '$data[1]',
            `email` = '$data[2]',
            `city` = '$data[3]',
            `image` = '$data[4]'") or die("could not insert into DB");
      }
      fclose($handle);
  }

  exit( "Complete!");
}
?>

csv.html

<form enctype="multipart/form-data" method="POST" action="">
      <input name="csvfile" type="file">
      <input type="submit" name="csvimport" value="Upload">
    </form>

Please share your comments and feedback.Thanks.Please subscribe my updates via email.

Friday, June 20, 2014

Add facebook recommendations bar in website

In this post am going to show how to add facebook recommendations bar in website.Facebook recommendations bar is used to get more likes and followers in page or post for websites and blogs.We can easily integrate facebook recommendations bar in website.





Let's have look.

 Steps:

Step 1: Please click this Link to go to facebook developers page
Step 2: Please enter Recommended URL in URL box,Domain and Select your customization options.

Step 3: Click Get Code Button.
Step 4: Copy & paste the code in your Web page.
        4.1. Include the JavaScript SDK on your page once, ideally right after the opening <body> tag.

Your Code look Like this

    <div id="fb-root"></div>
<script>(function(d, s, id) {
  var js, fjs = d.getElementsByTagName(s)[0];
  if (d.getElementById(id)) return;
  js = d.createElement(s); js.id = id;
  js.src = "//connect.facebook.net/en_US/sdk.js#xfbml=1&version=v2.0";
  fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>

Place the code for your plugin wherever you want the plugin to appear on your page.

<div class="fb-recommendations-bar" data-href="https://developers.facebook.com/codeinnovators" data-site="codeinnovators.blogspot.com" data-read-time="30" data-side="right" data-action="recommend"></div>

Please share your comments and feedback.Thanks.Please subscribe my updates via email.