Saturday, February 22, 2020

How to force redirect www or non-www using htaccess file?

Force www:

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

Force non-www:

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

Now, when you type in your domain name with either www in front or not, it should display as you have set it in the .htaccess file.

Be sure to replace 'yourwebsite.com' with your actual domain name.

Note: do not place both selections of code in the file as it will cause an error.

Different Text Column Data Types and Maximum Storage Sizes in MySQL

The actual text column type is classified in to four:

  1. TINYTEXT
  2. TEXT
  3. MEDIUMTEXT
  4. LONG TEXT

The maximum length that you can store in a column of each data type is given below.

      Type | Maximum length
-----------+-------------------------------------
  TINYTEXT |           255 (2 8−1) bytes
      TEXT |        65,535 (216−1) bytes = 64 KiB
MEDIUMTEXT |    16,777,215 (224−1) bytes = 16 MiB
  LONGTEXT | 4,294,967,295 (232−1) bytes =  4 GiB

Note: The number of characters that can be stored in your column will depend on the character encoding.

Kurai Ondrum Illai - Lakshmi Kataksham Video Song

Thursday, February 20, 2020

Refresh (or) Reload Web Page using Meta Tag

You can refresh (or) reload HTML web page using meta tag without script tag as given below.

<meta http-equiv="refresh" content="5">

The above code will reload the same page in 5 seconds.

To reload the page immediately you should set content="0".

Redirect to Specific URL

To redirect the page to different URL you should follow the code as given below.

<meta http-equiv="refresh" content="5;url=http://www.yourwebsite.com">

Note:

  • Meta tag is always placed inside the <head> tag.
  • Meta tag provides information about contents in the html page.

Should I put input elements inside a label element?

The label itself may be positioned before, after or around the associated control.

Example 1:

<label for="lastname">Last Name</label>
<input type="text" id="lastname" />

Example 2:

<input type="text" id="lastname" />
<label for="lastname">Last Name</label>

Example 3:

<label>
    <input type="text" name="lastname" />
    Last Name
</label>

Note: the third technique cannot be used when a table is being used for layout, with the label in one cell and its associated form field in another cell.

Either one is valid. I like to use either the first or second example, as it gives you more style control.

Wednesday, February 19, 2020

The Complete Linux Course: Beginner to Power User!

If you want to get started using Linux, you will LOVE this course! This 7+ hour Ubuntu Linux tutorial will take you from beginner to power user. We will cover installation, command line, administrative privileges, app development, server hosting, GitHub, and much more!

Tuesday, February 18, 2020

இந்த உலகில் வெறும் 100 பேர் மட்டும் இருந்தால்

What if the world has just 100 people

இந்த உலகத்தில் வெறும் 100 பேர் மட்டும் இருந்தால் என்ன நடக்கும்

This video talks about what if world has just 100 people

  • how many of them will men and women
  • what languages do they speak?
  • what food they would eat?
  • what color they would be
  • how much do they earn
  • will they have water?
  • will they have shelter
  • this video will inspire you to change and your look towards world and many such interesting facts about world tamil psychology

Sunday, February 16, 2020

How to use .htaccess file on an Apache Localhost Server

.htaccess is a configuration file that should be stored where your page is.

In short, it should be in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\ (or) custom folder --> D:\dev\www\.

Don't forget to turn on mod_rewrite by deleting a hash from the line where it resides LoadModule rewrite_module modules/mod_rewrite.so and enable .htaccess by changing AllowOverride None to AllowOverride All

This was clearly explained as follows:

  1. Find your apache directly which uses the php installation
  2. Open your httpd.conf with notepad, Which is located in the path \apache\conf directory
  3. Find the code like below
#LoadModule rewrite_module modules/mod_rewrite.so
  1. Remove # from above code
  2. Make sure the line is AllowOverride None as shown below.
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
# Options FileInfo AuthConfig Limit
#
AllowOverride All <--- change this line to AllowOverride None
  1. Save httpd.conf file
  2. Restart your apache server

Friday, February 14, 2020

What is the best way to reload (or) refresh an iframe using JavaScript?

Solution 1:

document.getElementById('iframeid').contentWindow.location.reload();

be careful, in Firefox, window.frames[] cannot be indexed by id, but by name or index.

Solution 2:

document.getElementById('iframeid').src = document.getElementById('iframeid').src;

It will reload the iframe, even across domains! Tested with IE7/8, Firefox and Chrome.

Solution 3:

If using jQuery, this seems to work:

$('#iframeid').attr('src', $('#iframeid').attr('src'));

Thursday, February 13, 2020

What is the unicode character for the close symbol?

Unicode and larger font size alternatives for the close symbol [OR] multiplication sign ( × )

Multiplication X (U+2715)

Decimal HTML entity: &#10005;
Hex HTML entity: &#x2715;

Heavy Multiplication X (U+2716)

Decimal HTML entity: &#10006;
Hex HTML entity: &#x2716;

Cross Mark (U+274C)

Decimal HTML entity: &#10060;
Hex HTML entity: &#x274c;

Sunday, February 9, 2020

What is the difference between GET, POST and REQUEST method in PHP?

There are 2 methods to send HTML form data from 1 Page to another or HTML page to server side in PHP.

POST

It is a method in which data gets sent using packet which is not visible to any user on web-browser. it is secured compared to GET method.

GET

It is a method in which data gets sent with URL which is visible to user in address-bar of any web-browser. So, it’s not secure as POST method.

Now, There are total three methods to catch this data in PHP.

  • POST: It can catch the data which is sent using POST method.
  • GET: It can catch the data which is sent using GET method.
  • REQUEST: It can catch the data which is sent using both POST & GET methods.

Wednesday, February 5, 2020

Secret of 4th Dimension

4வது பரிமாணத்தில் கடவுள்.

A part(story) of credits goes to Carl Sagan and translated in Tamil.

Tuesday, February 4, 2020

Archaeological Importance of Tirukoilur

It has a number of temples both Vaishnava and Saiva sects, was once a capital of an important chieftain Malayaman of Sangam age datable to 3rd century BCE to 3rd century CE. To corroborate this, a Tamil Brahmi inscription at Jambai (near Tirukkovilur ) mentions about the king AthiyamanNedumanAnchi as SathiyaPutoAtiyanNedumanAnjihiIttaPali. MalaiyamanTirumudikkari was the illustrious ruler of this dynasty. The Sangam works speak of the invasion of Tirukkoilur and defeat of MalayamanTirumudikkari by NedumanAnji, king of Takadur (modern Dharmapuri) who is said to have offered Avvaiyar, the celebrated poetess (of that period), a myrobalan (gooseberry) fruit to increase her longevity.

Tirukkoilur seems to have been as important a religious center as Kanchipuram in Tondaimandalam. There is ample evidence to prove that Vaishnavism, Saivism and Jainism had flourished at this center. It is said the MudalAlvars, the first three Alvars, (Poigai, Butham and Pei) were made to meet by the grace of Almighty in one place at Tirukkoilur and in ecstasy they sang poems on Ulagalandaperumal; these songs were known as Divyaprabhandam. The presiding deity of the temple TiruvikramaPerumal is still a wooden image and this retains its ancient character.

Tirukkoilur, which is also famous for Saivism, was sung by the Saiva saints as one of the Ashtavirattanams.

Kabilar rock stands in south pennarriver.It was named after Kabilar, a sanga poet who is friend and guide of parivallal.

Arakandanallur/ Aramkandanallur (Aram + Kanda + Nalla + oor) is a small village located near Tirukoilur. It has a Shiva temple (Athulyanatheswarar) built on a rock, very close to the banks of the river. This temple has archaeological importance. It has cave rooms carved out of the rock and it also has a sub-way inside of another adjacent rock leading to veemankundru. Local people believe that PanchaPandavas lived here during their time of Vanavasa. It is believed that Ramana Maharishi visited this temple.

How to change your default Index page in htaccess

Paste the following code at the top of the .htaccess file to configure your desired index page.

In the example below, we decided to make the index page of our folders named first.html.

#Alternate default index page
DirectoryIndex first.html

You can also list more than one file in the configuration.

The file will be read left to right and check for them in that order.

In this example, we add index.htm, index.html, and index.php to the list.

#Alternate default index pages
DirectoryIndex first.html index.htm index.html index.php

First the server will check for first.html, if it does not find a file with that name, it continues to index.htm and so on.

Monday, February 3, 2020

Write a Javascript program to print maximum number between 2 numbers?

Find the below code to print maximum number from 2 numbers in javascript.

Simple Idea

var a = 56,
    b = 67;

var max = (a > b) ? a : b;

console.log("The maximum number is "+ max);

Developed Idea

View Demo: http://www.gtvcreations.com/demo/js-print-max-from-two-numbers.html

View Code:

<!DOCTYPE html>
<html>

<head>
    <title>Print Maximum Number between Two Numbers - Javascript</title>
</head>

<body>
    <!-- Input Form -->
    <form id="findmaxform">
        <label for="number1">Number 1:</label>
        <input type="number" id="number1">
        <br>
        <label for="number2">Number 2:</label>
        <input type="number" id="number2">
        <br>
        <input type="submit" value="Print Maximum Number">
        <input type="reset" value="Reset Form">
    </form>

    <!-- Display Calculated Values -->
    <div id="result" style="display: none;">
        The maximum number is <b id="max"></b>
    </div>

    <!-- Javascript -->
    <script>
        // Show Result Function
        function showResult(event) {
            // Prevents Page Reload on Submit
            event.preventDefault();

            // Reset to Array Array
            var max = 0;

            // Get all Input Elments in array
            var inputElements = this.querySelectorAll("input[type='number']");

            // Logic - Compare value of all input elements
            for (var i = 0; i < inputElements.length; i++) {
                // Check it is not NaN
                if (!isNaN(Number(inputElements[i].value))) {
                    // Compare and Assign Value to `max` Variable
                    max = (max > Number(inputElements[i].value)) ? max : inputElements[i].value;
                }
            }

            document.getElementById("max").innerHTML = max;
           
            document.getElementById("result").style.display = "block";
        }

        // Clear Result
        function clearResult() {
            document.getElementById("result").style.display = "none";
        }

        // Add Submit and Reset Event
        document.getElementById("findmaxform").addEventListener("submit", showResult);
        document.getElementById("findmaxform").addEventListener("reset", clearResult);
    </script>
</body>

</html>

Note: If you want to print maximum from more than two numbers just add input field inside the form.

How to open Microsoft Edge from Run command box?

Follow the below steps to open Microsoft Edge from Run command box in Windows.

  1. Open the Run command box by simultaneously pressing Win + R
  2. In the Open field, type microsoft-edge: and then press Enter key to launch Microsoft Edge browser
    (or)
    In the Open field, type microsoft-edge:http://www.yourwebsite.com and then press Enter key to open the URL

Sunday, February 2, 2020

6 Reliable Alternatives to Windows 10 OS

You're looking for a new operating system for your computer?

Maybe you're on Windows 7 but don't want to use Windows 10.

This video provides a few realistic alternatives to Windows 10 that aren't made by Microsoft.

Saturday, February 1, 2020

How To Draw A Man From The Word "Man"

Learn with this step by step tutorial how to turn words into pictures, very easy art on paper for kids.

How to open Microsoft Edge from Command Prompt?

Follow the below steps to open Microsoft Edge from Command Prompt in Windows.

  1. Open the command prompt
  2. Type start microsoft-edge: command and then press Enter key to launch Microsoft Edge browser
    (or)
    Type start microsoft-edge:http://www.yourwebsite.com command and then press then Enter key to open the URL

Note: You can use the above commands to open Microsoft Edge from Windows PowerShell.