Posts

Showing posts from September, 2014

Make Alert Button using Javascript

Image
Make Alert Button using Javascript::::::::::::::::  <HTML> <HEAD>MY ALERT BOX</HEAD> <BODY>  <CENTER> <FORM> <INPUT TYPE="button" VALUE="Click here to be alerted" onClick='alert("There.  You have been  alerted.")'>   </FORM> </CENTER> <BODY> </HTML> OUTPUT:::::: tHaNkS fOR vISit :D

PHP Program Function to get Factorial of a Number

PHP Program Function to get Factorial of a Number   <?php /* Function to get Factorial of a Number */ function getFactorial ( $num ) {         $fact = 1 ;         for ( $i = 1 ; $i <= $num ; $i ++ )                 $fact = $fact * $i ;         return $fact ; } ?> <!doctype html> <html> <head> <title>Factorial Program in PHP</title> </head> <body> <form action = "" method="post"> Enter the number whose factorial requires to be found<Br /> <input type="number" name="number" id="number" maxlength="4" autofocus required/> <input type="submit" name="submit" value="Submit" /> </form> <?php if ( isset ( $_POST [ 'submit' ] ) and $_POST [ 'submit' ] == "Submit" ) {         if ( isset ( $_POST [ 'number' ] ) and is_n...

What is PHP?

What is PHP? PHP ( Hypertext Preprocessor ) is a widely-used open source general-purpose scripting language that is especially suited for web development and can be embedded into HTML.  Example #1 An introductory example <html>     <head>         <title>Example</title>     </head>     <body>          <?php              echo  "Hi, I'm a PHP!" ;          ?>     </body> </html> Instead of lots of commands to output HTML (as seen in C or Perl), PHP pages contain HTML with embedded code that does "something" (in this case, output "Hi, I'm a PHP script!"). The PHP code is enclosed in special start and end processing...

Web Development Life Cycle from Beginning to End…and BEYOND!

Web Development Life Cycle from Beginning to End…and BEYOND!  Phases of  Web Development Life  Cycle Planning Setting goals, specifying content, organizing content, and setting the user interface to navigate content Implementating: Creating content, implementing navigation and the user interface, and coding the site, which may include HTML, programming, and database development   Testing : User, browser, and system testing   Maintenance: Maintaining and updating the site, questioning old goals, and returning to the planning stage The Web Development Life Cycle     Considered to be a systematic plan Helps to ensure project consistency and completeness Should be used for a Web site of any size Phase 1: Planning the Site Step 1: Determine the purpose and goals of the site Personal or Business site State what will accomplish by having a Web site Main purposes of websites Entertainment  Information ...

PHP Function to get Factorial of a Number

<?php /* Function to get Factorial of a Number */ function getFactorial($num) { $fact = 1; for($i = 1; $i <= $num ;$i++) $fact = $fact * $i; return $fact; } ?> <!doctype html> <html> <head> <title>Factorial Program in PHP</title> </head> <body> <form action = "" method="post"> Enter the number whose factorial requires to be found<Br /> <input type="number" name="number" id="number" maxlength="4" autofocus required/> <input type="submit" name="submit" value="Submit" /> </form> <?php if(isset($_POST['submit']) and $_POST['submit'] == "Submit") { if(isset($_POST['number']) and is_numeric($_POST['number'])) { echo 'Factorial Number: <strong>'.getFactorial($_POST['number']).'</strong>'; } else { ech...

A java script program to make a simple calculator

A java script program to make a simple calculator   <html> <head> <title>A simple JavaScript calculator</title> <script language='JavaScript'> Default = "0"; Current = "0"; Operation = 0; MaxLength = 30; function AddDigit(dig) { if (Current.indexOf("!") == -1) { if ((eval(Current) == 0) && (Current.indexOf(".") == -1)) { Current = dig; } else { Current = Current + dig; } Current = Current.toLowerCase(); } else { Current = "Hint! Press 'AC'"; } if (Current.indexOf("e0") != -1) { var epos = Current.indexOf("e"); Current = Current.substring(0,epos+1) + Current.substring(epos+2); } if (Current.length > MaxLength) { Current = "Too long"; } document.Calculator.Display.value = Current; } function Dot() { i...

Frames

Image
Frames HTML frames allow authors to present documents in multiple views, which may be independent windows or subwindows. First introduced in Netscape Navigator 2.0. A framed page is actually made up of multiple HTML pages. There is one HTML document that describes how to break up the single browser window into multiple windowpanes. Each windowpane is filled with an HTML document. For Example to make a framed page with a windowpane on the left and one on the right requires three HTML pages. Doc1.html and Doc2.html are the pages that contain content. Frames.html is the page that describes the division of the single browser window into two windowpanes. Frame Page Architecture A <FRAMESET> element is placed in the html document before the <BODY> element. The <FRAMESET> describes the amount of screen given to each windowpane by dividing the screen into ROWS or COLS. The <FRAMESET> will then contain <FRAME> elements, one per division...

Simple Switch Case JavaScript Program

Simple Switch Case JavaScript Program  This is a simple switch case JavaScript example program for beginners.. <html> <head> <script type="text/javascript"> var n=prompt("Enter a number between 1 and 7"); switch (n) { case (n="1"): document.write("Sunday"); break; case (n="2"): document.write("Monday"); break; case (n="3"): document.write("Tuesday"); break; case (n="4"): document.write("Wednesday"); break; case (n="5"): document.write("Thursday"); break; case (n="6"): document.write("Friday"); break; case (n="7"): document.write("Saturday"); break; default: document.write("Invalid Weekday"); break } </script> </head> </html> Best of Luck

Check Odd/Even Numbers JavaScript Program

Check Odd/Even Numbers JavaScript Program  This is a simple JavaScript program to check o dd or even numbers  with example . <html> <head> <script type="text/javascript"> var n = prompt("Enter a number to find odd or even", "Type your number here"); n = parseInt(n); if (isNaN(n)) { alert("Please Enter a Number"); } else if (n == 0) { alert("The number is zero"); } else if (n%2) { alert("The number is odd"); } else { alert("The number is even"); } </script> </head> <body> </body> </html>

Palindrome JavaScript Program

Palindrome J avaScript Program  This is a simple  JavaScript  palindrome program  with example . <html> <body> <script type="text/javascript">   function Palindrome() {    var revStr = "";    var str = document.getElementById("str").value;    var i = str.length;    for(var j=i; j>=0; j--) {       revStr = revStr+str.charAt(j);    }    if(str == revStr) {       alert(str+" -is Palindrome");    } else {       alert(str+" -is not a Palindrome");    } } </script> <form >   Enter a String/Number: <input type="text" id="str" name="string" /><br />   <input type="submit" value="Check" onclick="Palindrome();"/> </form> </body> </html>

JavaScript Popup Window Program

J avaScript Popup Window Program This is a simple JavaScript example program to g enerate confirm box . <html> <head> <script type="text/javaScript"> function see() { var c= confirm("Click OK to see Google Homepage or CANCEL to see Bing Homepage"); if (c== true) { window.location="http://www.google.co.in/"; } else { window.location="http://www.gmail.com/"; } } </script> </head> <body> <center> <form> <input type="button" value="Click to chose either Google or gmail" onclick="see()"> </form> </center> </body> </html> Best of Luck

program to find factorial of a number using javascript.

program to find factorial of a number using javascript. <html> <head> <script type="text/javascript"> function factorial(f,n) { l=1; for(i=1;i<=n;i++) l=l*i; f.p.value=l; } </script> </head> <body> <form> number:<input type="text" name="t"></br> <input type="button" value="submit" onClick="factorial(this.form,t.value)"></br> result:<input type="text" name="p"></br> </form> </body> </html>  Best of Luck

JavaScript Program

Copy Text JavaScript Program (for beginners) This is simple JavaScript Program with example to Copy Text from Different Field. <html> <head> <title>Copy text</title> </head> <body> <center><h2>Copy text from different field</h2> <p> <input type="text" style="color: #FF0080;background-color: #C9C299" id="field1" value="Good Morning"> <input type="text" style="color: #FF0080;background-color: #C9C299" id="field2"> <button style="background-color: #E799A3" onclick="document.getElementById('field2').value = document.getElementById('field1').value">Click to Copy Text </p></center> </body> </html> Form Validation J avaScript Program  (for beginners) This is a simple JavaScript form validation program with example. ...

Fibonacci Series JavaScript Program

JavaScript Program Fibonacci Series JavaScript Program  <html> <body> <script type="text/javascript"> var a=0,b=1,c; document.write("Fibonacci"); while (b<=10) { document.write(c); document.write("<br/>"); c=a+b; a=b; b=c; } </script> </body> </html>      Best of Luck :P :P

Role of HTML in Web

Role of HTML in Web (part-1) HTML is just one part of a larger process for building and delivering Web pages. The Web includes the pages themselves, built with technologies such as HTML, the software and hardware that serve up the pages, the Internet and its connectivity issues, and the browsers that render the pages. The document author has very little control over anything other than the structure of the page. How quickly it gets to an end user, and what it looks like on the end user’s browser, can vary from browser to browser. Web also allows open access to any platform, which is what makes it so powerful. Historical Roots of HTML In 1989, Berners-Lee had the task of creating a hypertext delivery environment that could be used as an interface to scientific information, and that could render this information equally well on Macintosh systems with small screens, NeXT Workstations, IBM PCs, and a variety of other platforms. Berners-Lee developed the first versions of HTML, op...

How to Set up a Dial up Internet Connection

Image
How to Set up a Dial up Internet Connection Call a internet service provider (Bell, Rogers, Wightman) to obtain your internet service.   Make sure your PC is plugged in.  Connect a telephone cord from the back of your PC to the Telephone jack outlet located on the wall of the room you are in. Turn your PC power on.     Go to the control panel.   Go to network connections Create a new connection.   A small window will pop up, just click the next button once.   Click on “set up my connection manually”.  Click the next button.   Click on “connect using a dial up modem”.  Then click the next button.   You will now be asked to type in your internet’s ISP name.     The setup will now tell you that you have completed setting up the internet connection.  Click the finish button. To set up a broadband...

HTML Doctype

HTML Doctype Learning Outcomes How to write comment in HTML? How to write Acronym/Abbreviation such as to show its full version when you mouse over the respective element. HTML <!--...--> Tag The comment tag is used to insert comments in the source code. Comments are not displayed in the browsers. You can use comments to explain your code, which can help you when you edit the source code at a later date.  This is especially useful if you have a lot of code. e.g. <!--This is a comment. Comments are not displayed in the browser--> <p>This is a paragraph.</p> HTML <!DOCTYPE> Declaration The <!DOCTYPE> declaration must be the very first thing in your HTML document, before the <html> tag. The <!DOCTYPE> declaration is not an HTML tag; It is an instruction to the web browser about what version of HTML the page is written in. e.g.  <!DOCTYPE html> <html> <head...

Simple HTML programs

How to set the background color using HTML code?   <html> <head> <style type="text/css"> body {background-color: yellow} h1 {background-color: #00ff00} h2 {background-color: transparent} p {background-color: rgb(250,0,255)} </style> </head> <body> <h1>This is header 1</h1> <h2>This is header 2</h2> <p>This is a paragraph</p> </body> </html>   How to set an image as the background using HTML code?   <html> <head> <style type="text/css"> body { background-image: url('bgdesert.jpg') } </style> </head> <body> </body>  </html>   How to repeat a background image? <html> <head> <style type="text/css"> body { background-image: url('bgdesert.jpg'); background-repeat: repeat } </style> </head>  <body> </body> </html>   How to place the background ...

HTML Tables

The HTML tables are created using the <table> tag in which the <tr> tag is used to create table rows and <td> tag is used to create data cells. Example <!DOCTYPE html> <html> <head> <title> HTML Tables </title> </head> <body> <table border = "1" > <tr> <td> Row 1, Column 1 </td> <td> Row 1, Column 2 </td> </tr> <tr> <td> Row 2, Column 1 </td> <td> Row 2, Column 2 </td> </tr> </table> </body> </html>   This will produce following result:   Row 1, Column 1 Row 1, Column 2 Row 2, Column 1 Row 2, Column 2 Here border is an attribute of <table> tag and it is used to put a border across all the cells. If you do not need a border then you can use border="0". Table Heading Table heading can be defined using <th> tag. This tag will be put to replace <td> ...