Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 2. ARTICLE ,HEADER, FOOTER
- <!DOCTYPE html <html> <title>HTML5</title>
- <meta charset="utf-8"> <style> body {
- font-family:Verdana,sans-serif; font-size:0.8em;
- } aside { float:right; height:620; width:300;
- border:1px solid; margin:5px; margin-bottom:15px;
- padding:8px; background-color:white; }
- header,footer,section,article { border:1px solid grey;
- margin:5px;margin-bottom:15px;padding:8px;
- background-color:white; } header,footer
- { color:white;background-color:#444;
- margin-bottom:5px; }article {
- width:700px; } section
- { background-color:#ddd; } nav ul {
- margin:0;padding:0; }nav ul li {
- display:inline; margin:5px; } </style> <body>
- <header><h1>Monday Times</h1>
- </header> <nav><ul> <li>Time Table</li>
- <li>Course</li> </ul></nav>
- <section><h2>News Section</h2>
- <aside><img src=" " width=300 height="200"><br><br><br>
- Welcome <br> to <br> NCJ <br> </aside>
- <article><h2>News Article1</h2><p>
- <table border=1> <tr> <th>9.30</th> <th>10.30</th>
- <th>11.30</th> <th>12.30</th> </tr> <tr>
- <th>AI</th> <th>IT</th> <th>OOAD</th>
- <th>ADA</th></tr> <tr> <th>OOAD</th>
- <th>IT</th> <th>ADA</th> <th>AI</th> </tr> <tr>
- <th>IT</th> <th>AI</th> <th>OOAD</th>
- <th>ADA</th> </tr> </table> </p> </article>
- <article> <h2>News Article </h2> <p>.BCA<br>
- .B.Sc<br> .BA<br> .B.Com<br> </P><P>M.Sc<br>
- .COMPUTER SCIENCE<br> .PHYSICS<br> .MATHS<br>
- </article> </section>
- <footer><p>©
- 2015 National College Jayanagar. All rights reserved.
- </p></footer> </body> </html>
- 3. MArquee
- <!DOCTYPE html> <html> <head>
- <title>Insert title here</title> <style type="text/css">
- img{opacity:0.5;} marquee { height:100%;
- bottom:0; width:200px; float:right; }
- img:hover {opacity:1} li{ color:purple;
- font-family:Algerian; } </style> </head> <body>
- <marquee onmouseover="stop()" onmouseout="start()" scrollamount="2" direction="up" behavior="scroll">
- <img src="C:\Users\HARI\Desktop\aa.jpg"><br>
- <img alt="IMG2" width=100 height=100 src="C:\Users\HARI\Desktop\aa.jpg"><br>
- <img alt="IMG3" width=100 height=100 src="C:\Users\HARI\Desktop\aa.jpg"><br>
- <img alt="IMG4" width=100 height=100 src="C:\Users\HARI\Desktop\aa.jpgs"><br>
- <img alt="IMG5" width=100 height=100 src="Koala.jpg">
- </marquee> <header> LIST OF IMAGES DISPLAYED
- </header> <ol> <li>BLUE HILLS</li> <li>SUN SET</li>
- <li>LILLIES</li> <li>WINTER</li> </ol> </body>
- </html>
- 4. Calc
- <html><head></head><body><h3>Simple Calculator</h3><br/>
- <form Name="calc"> <table id="calc" border=2> <tr>
- <td colspan=5><input id="btn" name="display" onkeypress="return event.charCode >= 48 && event.charCode <= 57" type="text"></td>
- <td style="display:none"><input name="M" type="number"></td>
- </tr> <tr>
- <td><input id="btn" type=button value="MC" OnClick="calc.M.value=''"></td>
- <td><input id="btn" type=button value="0" OnClick="calc.display.value+='0'"></td>
- <td><input id="btn" type=button value="1" OnClick="calc.display.value+='1'"></td>
- <td><input id="btn" type=button value="2" OnClick="calc.display.value+='2'"></td>
- <td><input id="btn" type=button value="+" OnClick="calc.display.value+='+'"></td> </tr> <tr>
- <td><input id="btn" type=button value="MS" OnClick="calc.M.value=calc.display.value"></td>
- <td><input id="btn" type=button value="3" OnClick="calc.display.value+='3'"></td>
- <td><input id="btn" type=button value="4" OnClick="calc.display.value+='4'"></td>
- <td><input id="btn" type=button value="5" OnClick="calc.display.value+='5'"></td>
- <td><input id="btn" type=button value="-" OnClick="calc.display.value+='-'"></td> </tr> <tr>
- <td><input id="btn" type=button value="MR" OnClick="calc.display.value=calc.M.value"></td>
- <td><input id="btn" type=button value="6" OnClick="calc.display.value+='6'"></td>
- <td><input id="btn" type=button value="7" OnClick="calc.display.value+='7'"></td>
- <td><input id="btn" type=button value="8" OnClick="calc.display.value+='8'"></td>
- <td><input id="btn" type=button value="x" OnClick="calc.display.value+='*'"></td> </tr><tr>
- <td><input id="btn" type=button value="M+" OnClick="calc.M.value=(Number(calc.M.value))+(Number
- (calc.display.value))"></td>
- <td><input id="btn" type=button value="9" OnClick="calc.display.value+='9'"></td>
- <td><input id="btn" type=button value="±"
- OnClick="calc.display.value=(calc.display.value==
- Math.abs(calc.display.value)?-(calc.display.value):
- Math.abs(calc.display.value))"> </td>
- <td><input id="btn" type=button value="=" OnClick="calc.display.value=eval(calc.display.value)"></td>
- <td><input id="btn" type=button value="/" OnClick="calc.display.value+='/'"></td>
- </tr>
- <tr>
- <td><input id="btn" type=button value="1/x" OnClick="calc.display.value=1/calc.display.value"></td>
- <td><input id="btn" type=button value="." OnClick="calc.display.value+='.'"></td>
- <td><input id="btn" type=button value="x2" OnClick="calc.display.value=Math.pow(calc.display.value,2)"></td>
- <td><input id="btn" type=button value="v" OnClick="calc.display.value=Math.sqrt(calc.display.value)"></td>
- <td><input id="btn" type=button value="C" OnClick="calc.display.value=''"></td>
- </tr></table></form></body></html>
- 5. sort
- <!DOCTYPE html> <html> <head>
- <meta charset="ISO=8859-1"><title>insert title here</title>
- </head> <body> <p>sort a set of names <script>
- var i=0,j,temp,n var names=new Array()
- n=prompt("enter new name,or OK to end"," ")
- while(n != "") { document.write("<br>" + n)
- names[names.length] = n
- n=prompt("enter new name,or OK to end","") }
- document.write("<p>"+names.length+"names")
- for(i=0;i<names.length-1;i++) {
- for(j=i+1;j<names.length;j++) {
- if(names[i]>names[j]) { temp = names[i]
- names[i] = names[j] names[j] = temp } } }
- for(i=0;i<names.length;i++)
- document.write("<br>"+names[i]);
- </script>
- </body>
- </html>
- 6. results stds <!DOCTYPE html> <html> <head>
- <script language="javascript"> function cal() {
- var m1,m2,m3,m4,avg=0,total=0,result="",grade="";
- m1=parseInt(document.student.s1.value);
- m2=parseInt(document.student.s2.value);
- m3=parseInt(document.student.s3.value);
- m4=parseInt(document.student.s4.value);
- total=m1+m2+m3+m4; avg=total/4; alert(avg);
- if(m1<35||m2<35||m3<35||m4<35) { result="fail";
- grade="D"; } else if(avg>=75) { result="distinction";
- grade="A+"; } else if(avg>=60||avg<75) {
- result="first class"; grade="A" }
- else if(avg>=50||avg<60) { result="second class";
- grade="B"; } else if(avg>=35||avg<50) {
- result="pass class"; grade="C"; } else if(avg<35)
- { result="fail"; grade="D"; }
- document.student.result.value=result; *grade*total*avg*
- } </script> </head> <body> <h2><center>Result
- calculation for a student</center></h2><br/> <center>
- <form name="student" method="get" action="">
- Name  
- <input type="text" name="name" id="t1" value=""><br/><br/>
- class  
- <input type="text" name="cls" id="t2" value=""><br/><br/>
- sub1  
- <input type="text" name="s1" id="t3" value=""><br/><br/>
- sub2  
- <input type="text" name="s2" id="t4" value=""><br/><br/>
- sub3  
- <input type="text" name="s3" id="t5 value=""><br/><br/>
- sub4  
- <input type="text" name="s4" id="t6" value=""><br/><br/>
- <input type="button" onclick="cal()" value="calculate">
- <br/><br/><br/>total  
- <input type="text" name="total" id="t7" value=""><br/><br/>
- average
- <input type="text" name="avg" id="t8" value=""><br/><br/>
- result  
- <input type="text" name="result" id="t9" value=""><br/><br/>
- grade  
- 7. Fibo n sqrt <html> <head>
- <title>Insert title here</title>
- <script type="text/javascript"> function sqr() {
- var n=prompt("enter a positive value for n","");
- while(n<=0) { alert("enter positive value");
- n=prompt("enter positive value for n"," "); }
- var sq="numbers and their square \n";
- document.write("numbers and their square values
- using alert <br />"); for(i=1;i<=n;i++) {
- sq=(sq+i+"==>"+i*i+"\n"); } alert(sq); }
- function fib() { var a=0; var b=1; var c,i; var str;
- var n=prompt("enter a number"," "); while(n<=0)
- { alert("enter the nos"); n=prompt("enter a
- number"," "); }
- document.write("fibonacci series<br />");
- str=a+"\n"+b; for(i=0;i<n-2;i++) { c=a+b;
- str=(str+"\n"+c); a=b; b=c; } alert(str); }
- </script> </head> <body> <form >
- <h1>Click on the button to calculate the Square of a
- series or Fib of a number</h1>
- 8. Php login Php prgm <!DOCTYPE html> <html>
- <head> <meta charset="ISO-8859-1">
- <title>insert title here</title> </head> <body>
- <h1>login page</h1>
- <form action ="LOGO.php" method="post">
- user name:<input type="text" name="uname">
- password:<input type=text" name="pass">
- <input type="submit" value="login">
- </form> </body> </html>
- php file <?php $username="root"; $password="";
- $database="login"; $first=$_POST["uname"];
- $pa=$_POST["pass"];
- $con=mysql_connect("localhost",$username,$password);
- mysql_select_db("login",$con); $query="select * from log";
- $result=mysql_query($query); $f=1;
- while($row=mysql_fetch_array($result)) {
- if($row['uname']==$first && $row['pass']==$pa) {
- $f=2; } } if($f==1) { echo "login not correct"; }
- else { echo "correct"; header("location:success.html");
- } mysql_close(); ?>
- 10. Bank transaction <html> <head>
- <title>Insert title here</title> </head> <body>
- <form action="Bank_log.php" method="post">
- you Number:<input type="text" name="acc"><br>
- Pin :<input type="number" name="pin">
- <input type="submit" name="check" value="check">
- </form> </body> </html> login php <?php
- $username="root"; $password=""; $database="bankdb";
- $first=$_POST["acc"];$pa=$_POST["pin"];
- session_start(); $_SESSION['myValue']=$first;
- $con = mysql_connect("localhost",$username,$password);
- mysql_select_db("bankdb",$con);
- $query = "select * from bank1";$result=mysql_query($query);
- $f=1; while($row = mysql_fetch_array($result)) {
- if($row['acc'] == $first && $row['pin'] == $pa) { $f=0;
- header("location:Bank_Wit.html"); } } if($f==1)
- { echo "login incorrect"; } mysql_close(); ?>
- operation html <!DOCTYPE html> <html> <head>
- <meta charset="ISO-8859-1"> <title>Insert title here
- </title> </head> <body>
- <form action="Bank_updat.php" method="post">
- <select name="sel"> <option>Withdraw</option>
- <option>Deposit</option> </select>
- Enter ur amount:<input type="text" name="amt">
- <input type="submit" name="sub" value="update">
- </form> </body> </html>
- update php <?php $username="root"; $password="";
- $database="bankdb"; $wit=$_POST["sel"];
- $amt=$_POST["amt"];
- $con = mysql_connect("localhost",$username,$password);
- mysql_select_db("bankdb",$con); session_start();
- $a= $_SESSION['myValue']; $query = "select * from bank1";
- $result=mysql_query($query); $am=0; $f=1;
- while($row = mysql_fetch_array($result))
- { if($row['acc']==$a) { if ($wit=="Withdraw" ) {
- $am=$row['amt']-$amt; echo"record updated"; }
- if ($wit=="Deposit") { $am=$row['amt']+$amt;
- echo "record add"; } } }
- $query="update bank1 set amt='$am' where acc='$a' ";
- $result=mysql_query($query); mysql_close(); ?>
- 10. Cookies <!DOCTYPE html> <html> <head>
- <meta charset="ISO-8859-1"> <title>Insert title here
- </title> </head> <body>
- <form method='post' action='cookies_sess.php'>
- To: (Email) <br />
- <input type='text' name='recipient' size='35' /> <p/>
- Subject: <br />
- <input type='text' name='topic' size ='35' /> <br />
- Mail Message: <br />
- <textarea name='message' rows='4' cols='40'>
- </textarea> <br />
- <input type='submit' value='Send Message' />
- <br /> </form> </body> </html>
- php <?php $intime=60*60*24+time();
- setcookie('lastvisit',date("G:i -m/d/y"),$intime);
- if(isset($_COOKIE['lastvisit'])) { $visit=$_COOKIE['lastvisit'];
- echo "you last visit was",$visit; } else
- echo"cookies expired"; session_start();
- if(isset($_SESSION["vie"]))
- $_SESSION["vie"]=$_SESSION["vie"]+1; else
- 11. form validation <!DOCTYPE html> <html>
- <head> <meta charset="ISO-8859-1">
- <title>Insert title here</title>
- <script type="text/javascript"> function val()
- { var nam=document.fname.nam;
- var pas=document.fname.pass;
- var pas1=document.fname.rpass;
- var em=document.fname.email;
- var no=document.fname.mno;
- var dob=document.fname.db;
- if(nam.value==""||nam.value==null)
- { alert("Name Should not be empty");
- nam.focus(); nam.style.background = 'Yellow';
- return false; } nam.style.background = 'white';
- if(pas.value==""||pas1.value=="") {
- alert("password must not be empty"); return false; }
- if(pas.value!=pas1.value) {
- alert("Password must match"); pas1.value="";
- pas1.focus(); pas1.style.background = 'Yellow';
- return false; } if(no.value.length != 10) {
- alert("enter 10 digit number"); no.focus();
- no.style.background = 'Yellow'; return false;
- } var dt=new Date(); alert(dt);
- var mon=dt.getMonth()-1; var day=dt.getDate();
- var year=dt.getFullYear(); var d=dob.value.slice(0,4);
- var m=dob.value.slice(5,7); var y=dob.value.slice(8,10);
- if((parseInt(y)<day)||(parseInt(m)<mon)||
- (parseInt(d)<day)) { alert ("invalid date");
- dob.focus(); dob.style.background = 'Yellow';
- return false; } return true; } </script> </head>
- <body> <form name="fname" action="welcome.html"
- onsubmit="return val()"><h2>Ticket Booking:<br></h2>
- <table> <tr><th> Enter your Name: </th><td><input type=
- "text" name="nam"><br></td> </tr> <tr><th>
- Enter the Password: </th><td> <input type="password"
- name="pass"><br></td></tr> <tr><th>
- Re enter the password: </th><td> <input type=
- "password" name="rpass"><br></td></tr> <tr><th>
- E-mail: </th><td> <input type="email" name=
- "email"><br></td></tr> <tr><th>
- <tr><th>Mobile Number: </th><td><input type=
- "number" name="mno"><br></td></tr>
- <tr><th>No of Tickets:</th><td> <select>
- <option>1</option> <option>2</option>
- <option>3</option> <option>4</option>
- <option>5</option> <option>6</option>
- </select><br></td></tr> <tr><th>
- Date: </th><td> <input type="date" name=
- "db"><br></td></tr> <tr><th rowspan=
- "2"><input type="submit" name="sub" value=
- "Book"><br></th></tr> </table>
- </form> </body> </html>
- 12. book <html> <body> <?php
- $username="root"; $password="";
- $database="bookdb";$con = mysql_connect("
- localhost",$username,$password);
- $db=mysql_select_db("bookdb",$con);
- $query = "select bname from book";
- $result=mysql_query($query); ?>
- <form method="post" action="bookdisp.php">
- search:<select name=sel> <?php
- while ($row = mysql_fetch_array($result))
- { ?> <option><?php echo $row['bname'];?>
- </option> <?php }?> </select>
- <input type="submit" value="search">
- </form> <?php mysql_close(); ?> </body></html>
- <?php $username="root"; $password="";
- $database="bookdb"; $selval=$_POST["sel"];
- $con = mysql_connect("localhost",$username,$password);
- mysql_select_db("bookdb",$con);
- $query = "select * from book where bname='$selval'";
- $result=mysql_query($query);
- echo "<table border=1><tr><th>BOOKID</th>
- <th>BOOKNAME</th><th>BOOKpublisher</th><th>
- BOOKNumber</th></tr>";
- $row = mysql_fetch_array($result);
- echo "<tr><td>",$row['bookid'] ,"</td><td> ", $row['bname']," </td><td>", $row['bpublisher']," </td><td>", $row['bnumber'],"</td><tr></table><br>";
- mysql_close();
- ?>
Add Comment
Please, Sign In to add comment