> 2013 ~ Online tutorial

75% discount Hosting plan sale in Hostgator

75% discount Hosting plan sale in HostgatorHostGator is one of the world's top 10 largest web hosting companies and offers the Black friday offer today. Offer In Hostgator Hostgator is offering 1 hour flash sale on Black friday, and you can grab hosting for as low as $1.24/month. Discount: Various discount from Black friday to Cyber monday. Start date:...

PHP interview Question with answer

PHP interview Question with answer1)<?php $varA=one; $varB=&$varA; $varA=two; print $varB; ?> Output: 2 It is result is Two because $varB holds the reference of $varA value an dboth $varA and $varB poin the same value. 2)<?php $num1=6; $num2=5; $val=(num1>$num2)?$num1:$num2; echo "Greatest of no".$val;num2; ?> Output: 6 It is...

How do Upload File using PHP

How do Upload File using PHPIn PHP we are using two file which used upload file in the server.First one Html file and another one is PHP file . In the Html file we are going get file content and PHP file we are process it and Upload into Particular file path. Coding In the coding section we are show First html file.In the html file we are going to...

change button color in javascript

change button color in javascriptIn the program we will show you How do change button color using javascript .In javascript we are using onmouseover it is used to record mouse move. Source code <html> <head> <script type="text/javascript"> function changeColor(color) { document.getElementById('MyButton').style.background=color; } </script> </head> <body> <p>Move...

How do search word in string using javascript

How do search word in string using javascript In program we will show How do get word from given string using java script.When you are using search keyword it is searching word in the given string if it is found then return 0 otherwise not return any value. Program <html> <head> <script type="text/javascript"> function...

How do get server date using PHP

How do get server date using PHP In this program i will show you how do get server date and time using PHP.In PHP getdate() function is used to get date in server. Program <?php $time = getdate(); $date = $time['day']; $month = $time['month']; $year = $time['year']; $hour = $time['hours']; $min = $time['minutes']; $sec = $time['seconds']; ...

How do get month using javascript

How do Get month using javascript In the java script we can using getMonth() function which is used to get current month. Program <html> <body> <script type="text/javascript"> d=new Date(); ch=d.getMonth(); document.write(ch); </script> </body> <html> Output: In this program The program will return...

Pop up box in javascript

Pop up box in java scriptIn this below coding is used to show How do create popup box using javascript. Alert box:In this type of pop up box some message will be displayed confirm box:In this type of popup box in which message about confimation will be displayed Prompt boxIn is a type of popup box which display text window in which user can enter...

make image using php

make image using php In this program we will create image using php.In the imagecreate is used to create the image space. <?php header("Content-Type: image/png"); $im = @imagecreate(500, 120) or die("Cannot Initialize new GD image stream"); $background_color = imagecolorallocate($im, 0, 0, 0); $text_color = imagecolorallocate($im,...

generate random in php

generate random in php In this program is used generate random number in PHP.we are using rand() used to generate random number in PHP. <?php echo rand() . "\n"; echo rand(10,4); ?> Previous program Next program ...

Upload file using PHP

Upload file using PHP HTML Coding In this example .i will show How upload file using PHP.we are two program here.one is HTM and PHP program. In the HTML file get the file and send to the PHP program using POST method. <html> <body> <form action="upload.php" enctype="multipart/form-data" method="post"> Select the file to upload<input...

get Http vs Https in php

get Http vs Https in phpIn this post. I will show you How do know your server protocol that is Http or https using PHP. Coding <?php if (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off'     || $_SERVER['SERVER_PORT'] == 443) {   // HTTPS echo 'https'; } else { echo 'http';  // HTTP } ?> Output: Previous...

Getting image width and height using PHP

Getting image width and height using PHP In Coding we are getting size of image using function getimagesize. it is get width and height of given object. Coding <?php   list($width, $height, $type, $attr) = getimagesize("C:\wamp\www\Batista.jpg");   echo "Image width <br/>" . $width."<br/>";   echo "Image...

Get ip address using php

Get ip address using php This tutorial i will show you get the IP(Internet Protocol)Address of proxy server. Coding <?php if (!empty($_SERVER['HTTP_CLIENT_IP'])) {      $ip=$_SERVER['HTTP_CLIENT_IP']; } elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {      $ip=$_SERVER['HTTP_X_FORWARDED_FOR']; } else {  ...

How do finding metatag using PHP

How do finding metatag using PHP: This tutorial i will show  how do find the metatag of website using PHP. They function called get_meta_tags Which is used to get information of meta tag in the website. Coding <?php $tags = get_meta_tags("http://www.w3schools.com"); ?> <h2>Author</h2> <?php echo $tags['author'];...

compare two number without using relational operator in c

#include<stdio.h> #include<conio.h> int main () { { int a,b; printf ( "enter the two values u like to compare\n"); scanf (" %d %d",&a,&b); if (!(a ^ b)) // ^ is Xor operator. Xor operator function below valuesvlauesOutput 000 011 101 110 printf ("both are equal\n"); else printf ("both are not equal\n"); } Output Enter...

HTML tag

tag nameDefinitionSyntax <a> An anchor text which it used to create hyperlinks in HTML. <a href='enter the website name'>Name of site</a> <b>Which is used to blod the text in HTML.<b>Enter the header name</b> <ul> Un ordered list which is list the item in HTML.list is nothing but collection of data....

registration form in php

Registration form: This is registration form in which data are entered by the user then it is goes to database for storing data.In this registration form we create four field and send data using form tag. <html> <body> <form name="form1" action="signup2.php" method="post"> Name<input type='text' name='name'> Email id<input...

send emails using php

Registration form We are create registration form which is important in data storing when the entered value in field the data are redirect value to corresponds method by using form tag.Now they store data in Mysql database for furthur processing on the data. <html> <body> <div align='left'> <table border='1'> <form name='form1'...

HTML list

HTML list List is nothing but the collection of items or elements.There are two type of list are ordered list,unordered list UnOrdered List: UnOrdered List is used for simply using listing the items but if we want the items in the sequence then ordered lists are used. HTML Unordered List Example <html> <body> <b>Fruit List</b> <ul...

HTML audio

Audio using html script we can play the audio files.The simplest way to play the audio use the hyperlinks. Syntax: <a href="location of file'>name of the audio</a> Syntax <html> <head> <title> HTML checkbox </title> </head> <body> <form name='form1'> <a href="chimes.wav'>Click the...

HTML spacing

Cellspaing Cellspacing is allows create distance from each cell can be increased. Example <html> <head> <title> HTML cellspacing </title> </head> <body> <table border="1" cellspacing="20"> <tr> <td>one</td> <td>second</td> </tr> <tr> <td>Three</td> <td>four</td> </tr> </table></body>  </html> ...

HTML cellpadding

Cellpadding Cellpadding is allows to have some space between of each cell and it is borders(or inner edges) Example <html> <head> <title> HTML cellpadding </title> </head> <body> <table border="1" cellpadding="8"> <tr> <td>one</td> <td>second</td> </tr> <tr> <...

HTML checkbox

Check Box It is simplest component which is used particularly whemn we used to make selection of serveral options. Syntx <input type='checkbox' name='check' value='value of checkbox'> Example <html> <head> <title> HTML checkbox </title> </head> <body> <form name='form1'> <input type='checkbox'...

HTML textarea

Text Area Text field is a form component which allows us to enter the single line text,what if we want to have multiple line text?Then you must use the text area components. Syntx &lttextarea cols='20' rows='20' name='myname'> Example <html> <head> <title> HTML Textarea </title> </head> <body> <form...

HTML button

Button There are two buttons that can be created in HTML.one is called submit button.and other is reset button. parameters of submit button name: denotes the name of the submit the button. value: It is writing some text on the text on button. align: specifies the alignment of the buttons. Example <html> <head> <title> HTML...

HTML text

HTML text Text is typically required to place one line text.for example if you want to enter name then it is always preferred to have Text field on the form.The text field can be set using <input type='text' size='size of text' value=""> Some other parameters can be name : indicates the name of text field Max length: That allow us to enter...

HTML forms

HTML forms Form is a typical layout on the webpage by which a user can interact with the web page. <form> tag is used to has an attribute action which gets executed when user clicks the button on the form. syntax Example <html> <head> <title> HTML forms </title> </head> <body> <form name='form1'...

HTML table

HTML table tags The table is a matrix of rows and columns and one area formed due to interaction of a row and a column is called cell To create a table on the web page the table beginning tag is <table>and </table>tag it is used to ending the tag. <html> <head> <title> HTML Table </title> </head> <body> <table...

HTML frameset

HTML frames HTML frames allow us to present document in multiple views.Using the multiple view we can keep certain information visible and at the same time other views are scrolled or replaced. <frameset cols="150,*"> This allow us to divide the two columns.(i.e vertical frames).One are occupying the size of 150 pixels and the other occupies...

HTML HyperLinks

HTML Hyperlinks              There is a common practice the specify the the web link in the webpage.The Link acts as a pointer to some web or some resource.Use the hyper links in the webpage allow page to link logically with other page.           We can use the hyperlinks by using a tag...

HTML Alignment

Text Alignment We can align the text at left,right,center using <div> tags. syntax <div align='left/center/right'> Example <html> <head> <title> HTML Alignment </title> </head> <body> <div align='left'>This is left align</div> <div align='right'>This is right align</div> <div...

HTML font

Font in html We can set the font,size and color of the text in the webpage.The tag <basefont>is the set the font. Syntax <basefont face=font_name> Example <html> <head> <title> Html font </title> </head> <body> <basefont face='arial' size='20'> Today is greeny day<br/> Today is graceful...

HTML formatting

Formatting the text Following are some commonly used tags to format the text TagMeaning <p>This tag is should be put at the every paragraph <br>This is tag causes the single line breaks.Generally it is kept at the end of every line <pre>This tag is used to perserve the white spaces and lines the text <div>This is tag...

html header

Displaying Header we are using header tags which helps to display the text as some header.The header tag is used by h1,h2,h3,h4,h5,h6 Example <html> <head> <title> HTML header </title> </head> <body> <h1>This is first header</h1> <h2>This is second header</h2> <h3>This is third header</h3> <h4>This...

HTML Syntax

HTML syntax An HTML document consists of three parts <html> <head>section <body>section <html> <head> <title> ------- </title> </head> <body> -------- </body> </html>...

HTML element

HTML Elements In the character enclosed within is basically as element.The element tree can be shown below In all HTML document the root element is <html>which has two children head and body .Any text contained does not appear in client area of web browser. The head element is used for providing certain information to web browser. The...

HTML Introduction

HTML stands for Hyper Text Markup Language(HTML).This is basically a scripting language.HTML is a SGML(Standard General Markup Language) HTML Introduction As we know HTML stands Hyper Text Markup Language.Hyper text is simply a piece of text that works as a link Markup Language is language of writing layout information within document.  <html> <title>My...

argument passed by reference

By default arguments are passed by value(so that it will changed inside function only not outside the function).So we are going the value then send value by reference,prepend by (&) to the argument name in the function definition. Syntax function fun_name(&$varname) Example <?php function my(&$num) { $num='welcome'; } $str="welcome"; my($str); echo...

passing arguments

Information may be passed to function via the argument list.which is a comma-delimited list of expression Example <?php function my($num) { echo "$num"; } my("india"); ?> Outpu...

conditional operator

The ? operator is equivalent to an if statement.it os called a terary operator because it takes three parameters an expression :an expression that is evaluated to be TRUE and FALSE an expression that is evaluates if it tree and expression evaluated if the first is FALSESyntax (expr1)?(expr2):(expr3); Example ?php $n=6; $b=7; $val=($num 1>b)?$n:$b; echo...

require_once in php

The require_once()statement include and evaluates the specified file during of execution of the script.This is a behavior similar to the require() function with the only difference being that it code from a file has already been included.It will not be included again.Syntax include "function name"; Example vars.php <?php $color='red'; $fruit='apple'; echo...

require in php

The require() function is identical to include() except that is handle error differently. The the function include() generates a warning(but the script continue execution) while the require() function generates a fatal error (and script stop) Syntax include "function name"; Example vars.php <?php $color='red'; $fruit='apple'; echo $fruit."color...

include_once in php

The include_once()statement include and evaluates the specified file during of execution of the script.This is a behavior similar to the include() function with the only difference being that it code from a file has already been included.It will not be included again.Syntax include "function name"; Example vars.php <?php $color='red'; $fruit='apple'; echo...

include in php

The include() function takes all the text in a specified file and copies it into file that used the include function Syntax include "function name"; Example vars.php <?php $color='red'; $fruit='apple'; echo $fruit."color is".$color" ?> test.php <?php echo "a $color $fruit" // include 'vars.php include 'vars.php' echo "a $color $fruit" ?> Output: ...

echo and print

The echo() and print() function are used to output the given argument.it can output all types single and multiple outputs can be made with these command Syntax int print(string $arg) void echo (string $arg1[,string $ ,,]) Similarities They both language constructs (not function)so they can be used without parentheses Example <?php echo "welcome...

PHP directory

PHP Directory Create directory Delete Directory read direct...

PHP file

PHP File PHP has powerful file handling function to manage file in a server.Some of these function require some special setting in php.ini and some available by default. Function in File write file read file open the fi...

localtime in php

The localtime() function returns the array that contains the time components of unix time system Syntax localtime(timestamp,is_associative) Example <?php print_r(localtime()); echo(" "); print_r(localtime(time(),true)); ?> output...

idate in php

idate() function formats a local time or date as integer Syntax idate(format,timestamp) Example <?php echo(idate("Y")): ?> Output:...

time in php

time() function returns the current time as unix tiemstamp (the number of seconds since jan 1 1970 00:00:00 GMT) Syntax time(void) Example <?php $curr=time(); print_r("$curr"); ?> Outpu...

getdate() in php

getdate() function returns an array that contains date and time information for unix system the returning array contain ten elements with relevant information needed when formatting a date [seconds]-seconds [minutes]-minutes [hours]-hours [mday]-day of month [wday]-day of week [year]-year [yday]-day of year [weekday]-name of the weekday [month]-name...

date and time in php

date and time function allow you to extract and format the date and time on the server. Note These function depend on the locale settings of the server date() date() function formats a local time/date The following describes the format arguments a:am or pm A:AM or PM d:Numeric day of the month D:Short day abbreviation F:Full month name g:12-hour time...