Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 1)TIMETABLE
- <html>
- <head>
- <link rel="stylesheet" href="tlink.css">
- </head>
- <table border="1">
- <tr>
- <th>DAYS</th>
- <th>9:30-10:30</th>
- <th>10:45-11:45</th>
- <th>11:45-12:45</th>
- <th>12:45-1:45</th>
- <th>1:45-2:30</th>
- <th>2:30-3:30</th>
- <th>3:30-4:30</th>
- <th>4:30-5:30</th>
- </tr>
- <tr>
- <td>MONDAY</td>
- <td> </td>
- <td>AI</td>
- <td>WP</td>
- <td>ADA</td>
- <td rowspan="6"> BREAK</td>
- <td> </td>
- <td> </td>
- <td> </td>
- </tr>
- <tr>
- <td>TUESDAY</td>
- <td> </td>
- <td>OOAD</td>
- <td>CN</td>
- <td>AI</td>
- <td>WP</td>
- <td> </td>
- <td> </td>
- </tr>
- <tr>
- <td>WEDNESDAY</td>
- <td colspan="3"><center>ADA LAB</center></td>
- <td>OOAD</td>
- <td>ADA</td>
- <td>WP</td>
- <td> </td>
- </tr>
- <tr>
- <td>THURSDAY</td>
- <td colspan="3"><center>WP LAB</center></td>
- <td>CN</td>
- <td>ADA</td>
- <td>AI</td>
- <td> </td>
- </tr>
- <tr>
- <td>FRIDAY</td>
- <td> </td>
- <td>AI</td>
- <td>CN</td>
- <td>OOAD</td>
- <td colspan="3"><center>PROJECT LAB</center></td>
- </tr>
- <tr>
- <td>SATURDAY</td>
- <td>ADA</td>
- <td>WP</td>
- <td>CN</td>
- <td>OOAD</td>
- <td> </td>
- <td> </td>
- <td> </td>
- </tr>
- -------------------------------------------------------------------------------------------------------------------------
- 2)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 alt="IMG1" width=100 height=100 src="C:\Documents and Settings\All Users\Documents\My Pictures\Sample Pictures\Blue hills.jpg"><br>
- <img alt="IMG2" width=100 height=100 src="C:\Documents and Settings\All Users\Documents\My Pictures\Sample Pictures\Sunset.jpg"><br>
- <img alt="IMG3" width=100 height=100 src="C:\Documents and Settings\All Users\Documents\My Pictures\Sample Pictures\Water lilies.jpg"><br>
- <img alt="IMG4" width=100 height=100 src="C:\Documents and Settings\All Users\Documents\My Pictures\Sample Pictures\Winter.jpg"><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>
- CSS
- img(opacity:0.5;}
- maequee(
- width:200px;
- }
- img hover{opacity:1}
- ol{
- type:disc;
- }
- li{
- color:blue;
- font-family:Bernard MT Condensed;
- }
- --------------------------------------------------------------------------------------------------------------------------------------
- 3)SECTION
- --------------------------------------------------------------------------------------------------------------------------------------
- <!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="C:\Documents and Settings\All Users\Documents\My Pictures\Sample Pictures\Blue hills.jpg" 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>
- --------------------------------------------------------------------------------------------------------------------------------------
- 4)FORM
- ---------------------------------------------------------------------------------------------------------------------------------------
- <!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);
- alert(m1);
- total=m1+m2+m3+m4;
- avg=total/4;
- 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;
- document.student.grade.value=grade;
- document.student.total.value=total;
- document.student.avg.value=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  
- <input type="text" name="grade" id="t10" value=""><br/><br/>
- </form></center>
- </body>
- </html>
- ---------------------------------------------------------------------------------------------------------------------------------------
- 5)CALCULATOR
- ---------------------------------------------------------------------------------------------------------------------------------------
- <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>
- --------------------------------------------------------------------------------------------------------------------------------------
- 6)Bank Transaction (PHP)
- <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();
- ?>
- ---------------------------------------------------------------------------------------------------------------------------------------
- 7)FORM VALIDATION/TICKET (PHP)
- <!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>
- -------------------------------------------------------------------------------------------------------------------------------------
- 8)Book Details (PHP)
- <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();
- ?>
- --------------------------------------------------------------------------------------------------------------------------------------
- 9)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
- $_SESSION['vie']=1;
- echo" page views=",$_SESSION["vie"];
- ?>
Add Comment
Please, Sign In to add comment