How can I add my facebook page view into my website

Facebook Page Plugin

The Page plugin lets you easily embed and promote any public Facebook Page on your website. Just like on Facebook, your visitors can like and share the Page without leaving your site.

Like: use this code, where you want to show.

<iframe src="https://www.facebook.com/plugins/page.php?href=https%3A%2F%2Fwww.facebook.com%2Fstackofcodes%2F&tabs=timeline&width=280&height=500&small_header=false&adapt_container_width=true&hide_cover=false&show_facepile=false&appId=335515700249473" width="280" height="500" style="border:none;overflow:hidden" scrolling="no" frameborder="0" allowTransparency="true" allow="encrypted-media"></iframe>

source: https://developers.facebook.com/docs/plugins/page-plugin

Redirect a WordPress site from non-WWW to WWW

Redirect a WordPress site from non-WWW to WWW

The following tutorial will show you how to redirect your WordPress site’s domain from non-www to www or vice versa. Redirecting one to the other is useful for SEO.

If you go to https://www.wordpress.org, you’ll see the URL changes a bit once you click enter. It goes to the non-www version. In order words, it goes to https://wordpress.org. It’s a subtle change and it’s usually not noticed by users.

So why have they done this? It’s because, technically, the two are different domains but they have the same content. Without the redirect, they end up with duplicate content. With the redirect, they only have one site, so only one set of content.

With only one set of content, they guarantee they won’t be penalized by search engines or have their ranking split.

To move your site to non-www, find your .htaccess file using your host’s file manager or an FTP client.

Within it, look for the following code:

RewriteEngine On

If the code isn’t there, insert it at the top of your file.

Then, to redirect non-www to www, use the following code directly below RewriteEngine On:

RewriteCond %{HTTP_HOST} ^yourdomain.com [NC]
RewriteRule ^(.*)$ http://www.yourdomain.com/$1 [L,R=301]

For www to non-www, use:

RewriteCond %{HTTP_HOST} ^www.yourdomain.com [NC]
RewriteRule ^(.*)$ http://yourdomain.com/$1 [L,R=301]

 

What’s the difference between MyISAM and InnoDB?

What’s the difference between MyISAM and InnoDB?

MYISAM:

  1.  MYISAM supports Table-level Locking
  2. MyISAM designed for need of speed
  3. MyISAM does not support foreign keys hence we call MySQL with MYISAM is DBMS
  4. MyISAM stores its tables, data and indexes in diskspace using separate three different files. (tablename.FRM, tablename.MYD, tablename.MYI)
  5. MYISAM not supports transaction. You cannot commit and rollback with MYISAM. Once you issue a command it’s done.
  6. MYISAM supports fulltext search
  7. You can use MyISAM, if the table is more static with lots of select and less update and delete.

INNODB:

  1. InnoDB supports Row-level Locking
  2. InnoDB designed for maximum performance when processing high volume of data
  3. InnoDB support foreign keys hence we call MySQL with InnoDB is RDBMS
  4. InnoDB stores its tables and indexes in a tablespace
  5. InnoDB supports transaction. You can commit and rollback with InnoDB

Jquery validation min and max length

Min length method:

Description: Makes the element require a given minimum length.

Return false if the element is

  • some kind of text input and its value is too short
  • a set of checkboxes that doesn’t have enough boxes checked
  • a select and doesn’t have enough options selected

Works with text inputs, selects and checkboxes.

Makes “field” required having at least 3 characters.

<!doctype html>
<html>
<head> 
<meta charset="utf-8"> 
<title>Makes "field" required having at least 3 characters.</title> 

<link rel="stylesheet" href="https://jqueryvalidation.org/files/demo/site-demos.css"> 
</head> 
<body> 
<form id="myform">
    <label for="field">Required, minimum length 3: </label> 
    <input type="text" class="left" id="field" name="field"> 
    <br/> 
    <input type="submit" value="Validate!"> 
</form> 
<script src="https://code.jquery.com/jquery-1.11.1.min.js"></script> <script src="https://cdn.jsdelivr.net/jquery.validation/1.16.0/jquery.validate.min.js"></script> 
<script src="https://cdn.jsdelivr.net/jquery.validation/1.16.0/additional-methods.min.js"></script>
 
<script> 
// just for the demos, avoids form submit 

jQuery.validator.setDefaults({ 
    debug: true, 
    success: "valid" 
}); 

$( "#myform" ).validate({ 
    rules: { 
       field: { 
          required: true, 
          minlength: 3 
       } 
    } 
}); 
</script> 
</body>
</html>