Monthly Archives: June 2015

Add JavaScript onto a web page

Good Morning Guys,
In this article, I share some idea related to javascript. The javascript is a client side programming language. There are serveral methods are available for adding javascript on a web page but there are two way with is commonly used by developers.If your script code is very short and only for single page then following ways is best.
a)You can place <script type=”text/javascript”> tag inside the <head> element.



Code:


Page Title






b).If your script code is very large then you can make a javascript file and add its path in the following way..

Code:


Page Title


The script tag contain some attributes:

  • defer : The script associate with script tag then the browser informs.
  • language : This is used to announce the version of javascript.
  • src: This is used for specify the URLs. The external file is included using src attributes.
  • type : Indicate the content type

Everybody can add javascript functions or script anywhere in HTML or PHP page inside the head or body sections. Here I share some basic guidelines to keep your document well structured.

  • Try to keep your script inside the document head.
  • If your script needs to run at a certain stage during page layout, it should be put at the correct stage of the document.
  • If the script is very small, then put it all where it will be used.
  • If it is larger, then put it inside the head inside a function, and you can then call that function when you need it.

Adding a script to the page

To insert JavaScript into a web page, use the <script> tag. You should use the type attribute to specify the type of script being used, which in the case of JavaScript is text/javascript.




This is an example of a script tag, used to include a script in your page:





If your script is incapable of providing its own fallback, but it is needed to access the page, you should include support for non-JavaScript browsers by using:





Using comments

Comments allow you to leave notes to yourself and other people in your script. The double slash indicates a single line comment.


Using external script files

You can also use a separate header file to contain the JavaScript (usually *.js) making it easy to share across pages




Commenting out your scripts

You can hide the script from them by commenting out your script with standard HTML comments. Browsers that understand script will simply ignore these comments, and will just interpret the script within them. The opening comment is ignored as if it were a normal single line JavaScript comment. The closing comment will not, so it needs to have a JavaScript comment put before it.


Dealing with XHTML





Controlling when the script is activated





How To Install WordPress

Hi Friends,
Today we discuss one different topic related to WordPress. This article shows how to install wordpress in locally or cpanel with clear picture.




STEP 1: Download the WordPress installation package

To start the wordpress installation, first you need to download the wordpress package from wordpress official site. Download and install the latest version of WordPress. Always try to install the stable version.

downloadwordpress



Once you click on the Download wordpress button , the installation package will be saved to your hard disk. Locate the installation package that you’ve just downloaded and extract it to a new folder.

STEP 2: Upload the WordPress Files to Your Server

You need to upload the extracted files and folders to your web server. The easiest way to upload the installation files is via FTP or cpanel. Once the download is complete, extract the archive and upload it to your web hosting account via FTP using a client application like Filezilla or cPanel->File Manager->Upload file.

STEP 3: Create a MySQL Database for WordPress to use

First create mysql database and user and assign full permission. Once you successfully create your MySQL Database and User, make sure you write down the database username, password and database name you’ve just created. You will need those for the installation process.

Database Creation
database_create



You successfully create the database in phpmyadmin

user Creation
adduser



Successfully create the user in phpmyadmin

STEP 4: Go through the installation process

Now it’s time to start the wordpress installation process. If you have uploaded WordPress in your public_html directory(testdomain.com).Go to http://testdomain.com/ in your preferred browser. The first thing you will notice is a message, telling you that you don’t have a wp-config.php file and you should create one.Just click on the Create a Configuration File button to proceed.

step4_wordpressinstall



On this page you will see a message, asking you to prepare the necessary information for the installation. Since we already have this information, simply press the Go! button.
step41_wordpress_install
Enter the details for your newly created MySQL database, username and password, and press the Sumbit button.




step42_wordpress_install



WordPress will now check if your details like database name, username, password are correct.If you have entered all the necessary information, then you will see the confirmation screen.Press the Run the Install button to proceed.

On the next screen you will have to enter the information about your administrative username and the title of your site.Once you fill in that information, press the Install WordPress button.

step43_wordpress_install

Your new WordPress application is installed. You can use the Login, to access your administrative backend and start posting in your new site.

step44_wordpress_install



We can done this same method in server(cpanel). We install the wordpress in Cpanel then we create database and user in mysql database wizard or mysql database

DISTINCT Keyword- SQL

Hi all,
Welcome to SQL world. The SQL is very useful in programming. The sql queries helps in developers. There are different types of keyword, joins, sub-queries and commands are available.
The DISTINCT keyword is used for remove the duplicate values from database table in SELECT query. The SELECT DISTINCT statement is used to return only different values.
In database table, the column may contain duplicate values; and if you want to display only unique values or different values. For this process we use the distinct values in SQL SELECT query.



SQL SELECT DISTINCT Syntax

SELECT DISTINCT column_name,column_name FROM table_name;

OR

SELECT DISTINCT expressions FROM tables WHERE conditions;

expressions: The columns or calculations that you wish to retrieve.




tables:The tables that you wish to retrieve records from. There must be at least one table listed in the FROM clause and we can use more than one table and field.

conditions:The conditions that must be met for the records to be selected.

Example:Employee table


EmployeeID employee_name
1 Thomas
2 Varghese
3 Jose
4 Varghese




SELECT DISTINCT employee_name FROM Employee;

OUTPUT





employee_name
Thomas
Varghese
Jose

EXAMPLE – WITH SINGLE FIELD

We can use the SQL DISTINCT in SELECT query to return a single field that removes the duplicates from the result set.

Eg:

SELECT DISTINCT city FROM City_table;

This SQL DISTINCT example would return all unique city values from the City_table table.




EXAMPLE – WITH MULTIPLE FIELDS

SQL DISTINCT in SELECT query to remove duplicates from more than one field in your SQL SELECT statement.

Eg:

SELECT DISTINCT city, state FROM City_table;




Return each unique city and state combination. In this case, the DISTINCT applies to each field listed after the DISTINCT keyword.

Popup Image Gallery

Hi friends,
Today I share one latest technique in CSS,jquery,javascript, html or php.
These technique are very useful for developing the site. In this article focus how to Popup the image gallery using CSS,jquery and javascript in php/html page.




This is simple, can edit style, change the image etc.To use it in a real life project for display the product or image gallery in website. We can specify the size of the image in gallery and popup window.$(“.mylink”).on(“click”, function (e) { } helps to popup the window with image and form on click.



demo

Code




Popup the image gallery with Enquiry form





Popup the image gallery with Enquiry form





download

How To Install WordPress Plugins

Hi Guys,
Today I share one important topic related to WordPress plugin. We know how to install wordpress plugin through wordpress dashboard.
But I share this article to wordpress beginers for reference with step by step with clear picture. To install worpress plugin you successfully install wordpress then we can install plugins, theme,page, post etc.

Install a Plugin using WordPress Plugin Search




For installing wordpress plugins using wordpress plugin search is the very easiest method of install wordpress plugins in wordpress dashboard. First thing you need to do is go to your WordPress admin dashboard and click on Plugins » Add New.

wordpress_pluginss



Search Plugins and add proper plugins through dashboard using install now button.

wordpress_pluginss1



WordPress will now download and install the plugin for you. After this, you will see the success message with a link to activate the plugin or return to plugin installer.

wordpress_pluginss2



Install a Plugin using the WordPress Admin Plugin Upload

Install the wordpress plugin in wordpress dashboard using upload method is very simple. First download the plugins into your local computer and upload it to wordpress plugin directory through wordpress dashboard using upload method.

plugin_upload



This will bring you to the plugin upload page. Here you need to click on the choose file button and select the plugin file you downloaded earlier to your computer.

plugin_upload1



After you have selected the file, you need to click on the install now button.

wordpress_pluginss2



WordPress plugins are the tools which provide additional functionality to your application. To install wordpress plugin first plugin put into ‘wp-content/plugins’ directory. Once the plugin is installed, you may activate it or deactivate it from the Plugins menu in your WP administration login(worpress dashboard).

step1_wordpress_plugin



The Plugins are put into wp-content/plugins directory, activate it from the administrator backend (wordpress dashboard).

step2_wordpress_plugins



In WordPress 2.7 and above you can install plugins directly from the admin area. Download the plugin to your computer, log in to your WP admin area and go to Plugins and Add New. Browse to the plugin archive and select it. Then click Install now and the plugin will be installed shortly.

step3_wordpress_plugin



For remove wordpress plugin, simply remove the directory for the plugin you would like to uninstall and it will be automatically deactivated.

Create Database with MYSQL and Insert Code in PHP

We are going to discuss about ‘how to create database and how to insert the field values in the database using php form’. This application used into all projects like registration form or insert the values to database operations.

Table Of Content

    • Database Creation
    • Table Creation




  • Form Creation and action

Database Creation

For creating database I am using WAMP sever, go to the localhost url and choose phpmyadmin(localhost/phpmyadmin) and click on the database then fill the name of the database and then click CREATE.

createdatabase1



And the database will be created as the name what we given

createdatabase2




Table Creation

createdatabase3



After the database created, we have to create a table. Name of the table and number of columns we want, and click Go.

createdatabase4

Filll all the field without fail, and click save to finish the table creation.

Form Creation and action

createdatabase5




Here we are going to insert values through form. Mainly database connection and insert code.

Database connection:

$con = new mysqli(‘localhost’,’root’,”,’abcd’);

Insert coding

if(isset($_POST[‘submit’]))
{
$uname=mysqli_real_escape_string($con,$_POST[‘name’]);
$email = mysqli_real_escape_string($con, $_POST[’email’]);
$name = mysqli_real_escape_string($con, $_POST[‘name’]);
$pass = mysqli_real_escape_string($con, $_POST[‘password’]);

$sql_row2=mysqli_query($con,”INSERT INTO registration(name,email,username,password)values(‘$uname’,’$email’,’$name’,’$pass’)”);

}

createdatabase6



FULL CODE

	


	
	Registration Form

 

Registration Form

 

 


 


 


 


 

 

 





How to Use WordPress Categories

WordPress categories are very basic way to organize your post. By using category, organize post into different categories such as topics. You can add parent and child category of your post possible. The main advantages of wordpress category is that, one post can be into more than one category.
You can add any new categories at any time, but make a note of the fact that categories can be sorted in WordPress in two ways: by name (alphabetically) or by ID numbe

How to create WordPress categories



For create new category in wordpress, click ‘POST->CATEGORY’ from wordpress dashboard. Clicking the Categories link will display the Categories page

wordpress_category1



On the left side of the page you will see a tab that allows you to create categories. Fill all the field like category name, slug(will be used in the category URLs) and the Add New Category button.)

wordpress_category_2



First category is ready. Let’s make a sub_category, fill in a name and slug the way you did with first category, but this time select family posts as parent for the new category. Then, press Add New Category once more to save thew new sub-category.

wordpress_category_3

How to assign posts to categories

If you create the category in wordpress dashboard, you can add post to category. There are two way to add the wordpress category into wordpress post.
First method is, open a particular post or write a new one and place a checkbox in the category you want to assign it to





wordpress_category4

Second method is, bulk add posts to a category. Go to Posts -> All Posts, select the posts you want to add to a category, click on the Bulk Actions tab, select Edit and finally press the Apply button.

wordpress_category_5

The posts you’ve marked previously belong to the category you’ve chosen.

wordpress_category_6

Create a WordPress Post

WordPress display different types of content with different title. Each item of such content is generally called as post. Adding post into your blog, first login admin panel and go to Posts then click ‘add new’. Post are displays reverse order in your home page.





wordpress_post_1

On this page you will see the wordpress post editior.The post editior contain some important parts. They are:




  • Title or Heading Box:Enter the title of your post. Avoid using the same title more than ones as that will cause problems. The title will show above your content in your theme.
  • Content Box:Add the actual content of your post. It has two tabs – Visual it use for the editor to format your text and Text it use for add your HTML code directly). You can add your writing, links, links to images, and any information you want to display on your site in content box.
  • Preview Button:Help to view the post before officially publishing it.
  • Publish Button:For publish your post into blog
  • Update Button: You can update the published post

Once you enter the content of your first WordPress post, you need to Publish it.

wordpress_post_2

Now go to the front page of your site to check out the newly created blog post.





wordpress_post3