Guest User

Untitled

a guest
Feb 6th, 2018
36
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 15.15 KB | None | 0 0
  1. 2. ARTICLE ,HEADER, FOOTER
  2. <!DOCTYPE html <html> <title>HTML5</title>
  3. <meta charset="utf-8"> <style> body {
  4. font-family:Verdana,sans-serif; font-size:0.8em;
  5. } aside { float:right; height:620; width:300;
  6. border:1px solid; margin:5px; margin-bottom:15px;
  7. padding:8px; background-color:white; }
  8. header,footer,section,article { border:1px solid grey;
  9. margin:5px;margin-bottom:15px;padding:8px;
  10. background-color:white; } header,footer
  11. { color:white;background-color:#444;
  12. margin-bottom:5px; }article {
  13. width:700px; } section
  14. { background-color:#ddd; } nav ul {
  15. margin:0;padding:0; }nav ul li {
  16. display:inline; margin:5px; } </style> <body>
  17. <header><h1>Monday Times</h1>
  18. </header> <nav><ul> <li>Time Table</li>
  19. <li>Course</li> </ul></nav>
  20. <section><h2>News Section</h2>
  21. <aside><img src=" " width=300 height="200"><br><br><br>
  22. Welcome <br> to <br> NCJ <br> </aside>
  23. <article><h2>News Article1</h2><p>
  24. <table border=1> <tr> <th>9.30</th> <th>10.30</th>
  25. <th>11.30</th> <th>12.30</th> </tr> <tr>
  26. <th>AI</th> <th>IT</th> <th>OOAD</th>
  27. <th>ADA</th></tr> <tr> <th>OOAD</th>
  28. <th>IT</th> <th>ADA</th> <th>AI</th> </tr> <tr>
  29. <th>IT</th> <th>AI</th> <th>OOAD</th>
  30. <th>ADA</th> </tr> </table> </p> </article>
  31. <article> <h2>News Article </h2> <p>.BCA<br>
  32. .B.Sc<br> .BA<br> .B.Com<br> </P><P>M.Sc<br>
  33. .COMPUTER SCIENCE<br> .PHYSICS<br> .MATHS<br>
  34. </article> </section>
  35. <footer><p>&copy;
  36. 2015 National College Jayanagar. All rights reserved.
  37. </p></footer> </body> </html>
  38.  
  39.  
  40.  
  41. 3. MArquee
  42. <!DOCTYPE html> <html> <head>
  43. <title>Insert title here</title> <style type="text/css">
  44. img{opacity:0.5;} marquee { height:100%;
  45. bottom:0; width:200px; float:right; }
  46. img:hover {opacity:1} li{ color:purple;
  47. font-family:Algerian; } </style> </head> <body>
  48. <marquee onmouseover="stop()" onmouseout="start()" scrollamount="2" direction="up" behavior="scroll">
  49. <img src="C:\Users\HARI\Desktop\aa.jpg"><br>
  50. <img alt="IMG2" width=100 height=100 src="C:\Users\HARI\Desktop\aa.jpg"><br>
  51. <img alt="IMG3" width=100 height=100 src="C:\Users\HARI\Desktop\aa.jpg"><br>
  52. <img alt="IMG4" width=100 height=100 src="C:\Users\HARI\Desktop\aa.jpgs"><br>
  53. <img alt="IMG5" width=100 height=100 src="Koala.jpg">
  54. </marquee> <header> LIST OF IMAGES DISPLAYED
  55. </header> <ol> <li>BLUE HILLS</li> <li>SUN SET</li>
  56. <li>LILLIES</li> <li>WINTER</li> </ol> </body>
  57. </html>
  58. 4. Calc
  59. <html><head></head><body><h3>Simple Calculator</h3><br/>
  60. <form Name="calc"> <table id="calc" border=2> <tr>
  61. <td colspan=5><input id="btn" name="display" onkeypress="return event.charCode >= 48 && event.charCode <= 57" type="text"></td>
  62. <td style="display:none"><input name="M" type="number"></td>
  63. </tr> <tr>
  64. <td><input id="btn" type=button value="MC" OnClick="calc.M.value=''"></td>
  65. <td><input id="btn" type=button value="0" OnClick="calc.display.value+='0'"></td>
  66. <td><input id="btn" type=button value="1" OnClick="calc.display.value+='1'"></td>
  67. <td><input id="btn" type=button value="2" OnClick="calc.display.value+='2'"></td>
  68. <td><input id="btn" type=button value="+" OnClick="calc.display.value+='+'"></td> </tr> <tr>
  69. <td><input id="btn" type=button value="MS" OnClick="calc.M.value=calc.display.value"></td>
  70. <td><input id="btn" type=button value="3" OnClick="calc.display.value+='3'"></td>
  71. <td><input id="btn" type=button value="4" OnClick="calc.display.value+='4'"></td>
  72. <td><input id="btn" type=button value="5" OnClick="calc.display.value+='5'"></td>
  73. <td><input id="btn" type=button value="-" OnClick="calc.display.value+='-'"></td> </tr> <tr>
  74. <td><input id="btn" type=button value="MR" OnClick="calc.display.value=calc.M.value"></td>
  75. <td><input id="btn" type=button value="6" OnClick="calc.display.value+='6'"></td>
  76. <td><input id="btn" type=button value="7" OnClick="calc.display.value+='7'"></td>
  77. <td><input id="btn" type=button value="8" OnClick="calc.display.value+='8'"></td>
  78. <td><input id="btn" type=button value="x" OnClick="calc.display.value+='*'"></td> </tr><tr>
  79. <td><input id="btn" type=button value="M+" OnClick="calc.M.value=(Number(calc.M.value))+(Number
  80. (calc.display.value))"></td>
  81. <td><input id="btn" type=button value="9" OnClick="calc.display.value+='9'"></td>
  82. <td><input id="btn" type=button value="±"
  83. OnClick="calc.display.value=(calc.display.value==
  84. Math.abs(calc.display.value)?-(calc.display.value):
  85. Math.abs(calc.display.value))"> </td>
  86. <td><input id="btn" type=button value="=" OnClick="calc.display.value=eval(calc.display.value)"></td>
  87. <td><input id="btn" type=button value="/" OnClick="calc.display.value+='/'"></td>
  88. </tr>
  89. <tr>
  90. <td><input id="btn" type=button value="1/x" OnClick="calc.display.value=1/calc.display.value"></td>
  91. <td><input id="btn" type=button value="." OnClick="calc.display.value+='.'"></td>
  92. <td><input id="btn" type=button value="x2" OnClick="calc.display.value=Math.pow(calc.display.value,2)"></td>
  93. <td><input id="btn" type=button value="v" OnClick="calc.display.value=Math.sqrt(calc.display.value)"></td>
  94. <td><input id="btn" type=button value="C" OnClick="calc.display.value=''"></td>
  95. </tr></table></form></body></html>
  96.  
  97.  
  98.  
  99.  
  100.  
  101. 5. sort
  102. <!DOCTYPE html> <html> <head>
  103. <meta charset="ISO=8859-1"><title>insert title here</title>
  104. </head> <body> <p>sort a set of names <script>
  105. var i=0,j,temp,n var names=new Array()
  106. n=prompt("enter new name,or OK to end"," ")
  107. while(n != "") { document.write("<br>" + n)
  108. names[names.length] = n
  109. n=prompt("enter new name,or OK to end","") }
  110. document.write("<p>"+names.length+"names")
  111. for(i=0;i<names.length-1;i++) {
  112. for(j=i+1;j<names.length;j++) {
  113. if(names[i]>names[j]) { temp = names[i]
  114. names[i] = names[j] names[j] = temp } } }
  115. for(i=0;i<names.length;i++)
  116. document.write("<br>"+names[i]);
  117. </script>
  118. </body>
  119. </html>
  120.  
  121. 6. results stds <!DOCTYPE html> <html> <head>
  122. <script language="javascript"> function cal() {
  123. var m1,m2,m3,m4,avg=0,total=0,result="",grade="";
  124. m1=parseInt(document.student.s1.value);
  125. m2=parseInt(document.student.s2.value);
  126. m3=parseInt(document.student.s3.value);
  127. m4=parseInt(document.student.s4.value);
  128. total=m1+m2+m3+m4; avg=total/4; alert(avg);
  129. if(m1<35||m2<35||m3<35||m4<35) { result="fail";
  130. grade="D"; } else if(avg>=75) { result="distinction";
  131. grade="A+"; } else if(avg>=60||avg<75) {
  132. result="first class"; grade="A" }
  133. else if(avg>=50||avg<60) { result="second class";
  134. grade="B"; } else if(avg>=35||avg<50) {
  135. result="pass class"; grade="C"; } else if(avg<35)
  136. { result="fail"; grade="D"; }
  137. document.student.result.value=result; *grade*total*avg*
  138. } </script> </head> <body> <h2><center>Result
  139. calculation for a student</center></h2><br/> <center>
  140. <form name="student" method="get" action="">
  141. Name &nbsp
  142. <input type="text" name="name" id="t1" value=""><br/><br/>
  143. class &nbsp;&nbsp
  144. <input type="text" name="cls" id="t2" value=""><br/><br/>
  145. sub1 &nbsp;&nbsp
  146. <input type="text" name="s1" id="t3" value=""><br/><br/>
  147. sub2 &nbsp;&nbsp
  148. <input type="text" name="s2" id="t4" value=""><br/><br/>
  149. sub3 &nbsp;&nbsp
  150. <input type="text" name="s3" id="t5 value=""><br/><br/>
  151. sub4 &nbsp;&nbsp
  152. <input type="text" name="s4" id="t6" value=""><br/><br/>
  153. <input type="button" onclick="cal()" value="calculate">
  154. <br/><br/><br/>total &nbsp;&nbsp
  155. <input type="text" name="total" id="t7" value=""><br/><br/>
  156. average
  157. <input type="text" name="avg" id="t8" value=""><br/><br/>
  158. result &nbsp;&nbsp
  159. <input type="text" name="result" id="t9" value=""><br/><br/>
  160. grade &nbsp;&nbsp
  161. 7. Fibo n sqrt <html> <head>
  162. <title>Insert title here</title>
  163. <script type="text/javascript"> function sqr() {
  164. var n=prompt("enter a positive value for n","");
  165. while(n<=0) { alert("enter positive value");
  166. n=prompt("enter positive value for n"," "); }
  167. var sq="numbers and their square \n";
  168. document.write("numbers and their square values
  169. using alert <br />"); for(i=1;i<=n;i++) {
  170. sq=(sq+i+"==>"+i*i+"\n"); } alert(sq); }
  171. function fib() { var a=0; var b=1; var c,i; var str;
  172. var n=prompt("enter a number"," "); while(n<=0)
  173. { alert("enter the nos"); n=prompt("enter a
  174. number"," "); }
  175. document.write("fibonacci series<br />");
  176. str=a+"\n"+b; for(i=0;i<n-2;i++) { c=a+b;
  177. str=(str+"\n"+c); a=b; b=c; } alert(str); }
  178. </script> </head> <body> <form >
  179. <h1>Click on the button to calculate the Square of a
  180. series or Fib of a number</h1>
  181. 8. Php login Php prgm <!DOCTYPE html> <html>
  182. <head> <meta charset="ISO-8859-1">
  183. <title>insert title here</title> </head> <body>
  184. <h1>login page</h1>
  185. <form action ="LOGO.php" method="post">
  186. user name:<input type="text" name="uname">
  187. password:<input type=text" name="pass">
  188. <input type="submit" value="login">
  189. </form> </body> </html>
  190. php file <?php $username="root"; $password="";
  191. $database="login"; $first=$_POST["uname"];
  192. $pa=$_POST["pass"];
  193. $con=mysql_connect("localhost",$username,$password);
  194. mysql_select_db("login",$con); $query="select * from log";
  195. $result=mysql_query($query); $f=1;
  196. while($row=mysql_fetch_array($result)) {
  197. if($row['uname']==$first && $row['pass']==$pa) {
  198. $f=2; } } if($f==1) { echo "login not correct"; }
  199. else { echo "correct"; header("location:success.html");
  200. } mysql_close(); ?>
  201. 10. Bank transaction <html> <head>
  202. <title>Insert title here</title> </head> <body>
  203. <form action="Bank_log.php" method="post">
  204. you Number:<input type="text" name="acc"><br>
  205. Pin :<input type="number" name="pin">
  206. <input type="submit" name="check" value="check">
  207. </form> </body> </html> login php <?php
  208. $username="root"; $password=""; $database="bankdb";
  209. $first=$_POST["acc"];$pa=$_POST["pin"];
  210. session_start(); $_SESSION['myValue']=$first;
  211. $con = mysql_connect("localhost",$username,$password);
  212. mysql_select_db("bankdb",$con);
  213. $query = "select * from bank1";$result=mysql_query($query);
  214. $f=1; while($row = mysql_fetch_array($result)) {
  215. if($row['acc'] == $first && $row['pin'] == $pa) { $f=0;
  216. header("location:Bank_Wit.html"); } } if($f==1)
  217. { echo "login incorrect"; } mysql_close(); ?>
  218. operation html <!DOCTYPE html> <html> <head>
  219. <meta charset="ISO-8859-1"> <title>Insert title here
  220. </title> </head> <body>
  221. <form action="Bank_updat.php" method="post">
  222. <select name="sel"> <option>Withdraw</option>
  223. <option>Deposit</option> </select>
  224. Enter ur amount:<input type="text" name="amt">
  225. <input type="submit" name="sub" value="update">
  226. </form> </body> </html>
  227. update php <?php $username="root"; $password="";
  228. $database="bankdb"; $wit=$_POST["sel"];
  229. $amt=$_POST["amt"];
  230. $con = mysql_connect("localhost",$username,$password);
  231. mysql_select_db("bankdb",$con); session_start();
  232. $a= $_SESSION['myValue']; $query = "select * from bank1";
  233. $result=mysql_query($query); $am=0; $f=1;
  234. while($row = mysql_fetch_array($result))
  235. { if($row['acc']==$a) { if ($wit=="Withdraw" ) {
  236. $am=$row['amt']-$amt; echo"record updated"; }
  237. if ($wit=="Deposit") { $am=$row['amt']+$amt;
  238. echo "record add"; } } }
  239. $query="update bank1 set amt='$am' where acc='$a' ";
  240. $result=mysql_query($query); mysql_close(); ?>
  241. 10. Cookies <!DOCTYPE html> <html> <head>
  242. <meta charset="ISO-8859-1"> <title>Insert title here
  243. </title> </head> <body>
  244. <form method='post' action='cookies_sess.php'>
  245. To: (Email) <br />
  246. <input type='text' name='recipient' size='35' /> <p/>
  247. Subject: <br />
  248. <input type='text' name='topic' size ='35' /> <br />
  249. Mail Message: <br />
  250. <textarea name='message' rows='4' cols='40'>
  251. </textarea> <br />
  252. <input type='submit' value='Send Message' />
  253. <br /> </form> </body> </html>
  254. php <?php $intime=60*60*24+time();
  255. setcookie('lastvisit',date("G:i -m/d/y"),$intime);
  256. if(isset($_COOKIE['lastvisit'])) { $visit=$_COOKIE['lastvisit'];
  257. echo "you last visit was",$visit; } else
  258. echo"cookies expired"; session_start();
  259. if(isset($_SESSION["vie"]))
  260. $_SESSION["vie"]=$_SESSION["vie"]+1; else
  261. 11. form validation <!DOCTYPE html> <html>
  262. <head> <meta charset="ISO-8859-1">
  263. <title>Insert title here</title>
  264. <script type="text/javascript"> function val()
  265. { var nam=document.fname.nam;
  266. var pas=document.fname.pass;
  267. var pas1=document.fname.rpass;
  268. var em=document.fname.email;
  269. var no=document.fname.mno;
  270. var dob=document.fname.db;
  271. if(nam.value==""||nam.value==null)
  272. { alert("Name Should not be empty");
  273. nam.focus(); nam.style.background = 'Yellow';
  274. return false; } nam.style.background = 'white';
  275. if(pas.value==""||pas1.value=="") {
  276. alert("password must not be empty"); return false; }
  277. if(pas.value!=pas1.value) {
  278. alert("Password must match"); pas1.value="";
  279. pas1.focus(); pas1.style.background = 'Yellow';
  280. return false; } if(no.value.length != 10) {
  281. alert("enter 10 digit number"); no.focus();
  282. no.style.background = 'Yellow'; return false;
  283. } var dt=new Date(); alert(dt);
  284. var mon=dt.getMonth()-1; var day=dt.getDate();
  285. var year=dt.getFullYear(); var d=dob.value.slice(0,4);
  286. var m=dob.value.slice(5,7); var y=dob.value.slice(8,10);
  287. if((parseInt(y)<day)||(parseInt(m)<mon)||
  288. (parseInt(d)<day)) { alert ("invalid date");
  289. dob.focus(); dob.style.background = 'Yellow';
  290. return false; } return true; } </script> </head>
  291. <body> <form name="fname" action="welcome.html"
  292. onsubmit="return val()"><h2>Ticket Booking:<br></h2>
  293. <table> <tr><th> Enter your Name: </th><td><input type=
  294. "text" name="nam"><br></td> </tr> <tr><th>
  295. Enter the Password: </th><td> <input type="password"
  296. name="pass"><br></td></tr> <tr><th>
  297. Re enter the password: </th><td> <input type=
  298. "password" name="rpass"><br></td></tr> <tr><th>
  299. E-mail: </th><td> <input type="email" name=
  300. "email"><br></td></tr> <tr><th>
  301. <tr><th>Mobile Number: </th><td><input type=
  302. "number" name="mno"><br></td></tr>
  303. <tr><th>No of Tickets:</th><td> <select>
  304. <option>1</option> <option>2</option>
  305. <option>3</option> <option>4</option>
  306. <option>5</option> <option>6</option>
  307. </select><br></td></tr> <tr><th>
  308. Date: </th><td> <input type="date" name=
  309. "db"><br></td></tr> <tr><th rowspan=
  310. "2"><input type="submit" name="sub" value=
  311. "Book"><br></th></tr> </table>
  312. </form> </body> </html>
  313.  
  314.  
  315.  
  316.  
  317.  
  318.  
  319.  
  320.  
  321. 12. book <html> <body> <?php
  322. $username="root"; $password="";
  323. $database="bookdb";$con = mysql_connect("
  324. localhost",$username,$password);
  325. $db=mysql_select_db("bookdb",$con);
  326. $query = "select bname from book";
  327. $result=mysql_query($query); ?>
  328. <form method="post" action="bookdisp.php">
  329. search:<select name=sel> <?php
  330. while ($row = mysql_fetch_array($result))
  331. { ?> <option><?php echo $row['bname'];?>
  332. </option> <?php }?> </select>
  333. <input type="submit" value="search">
  334. </form> <?php mysql_close(); ?> </body></html>
  335. <?php $username="root"; $password="";
  336. $database="bookdb"; $selval=$_POST["sel"];
  337. $con = mysql_connect("localhost",$username,$password);
  338. mysql_select_db("bookdb",$con);
  339. $query = "select * from book where bname='$selval'";
  340. $result=mysql_query($query);
  341. echo "<table border=1><tr><th>BOOKID</th>
  342. <th>BOOKNAME</th><th>BOOKpublisher</th><th>
  343. BOOKNumber</th></tr>";
  344. $row = mysql_fetch_array($result);
  345. echo "<tr><td>",$row['bookid'] ,"</td><td> ", $row['bname']," </td><td>", $row['bpublisher']," </td><td>", $row['bnumber'],"</td><tr></table><br>";
  346. mysql_close();
  347. ?>
Add Comment
Please, Sign In to add comment