Advertisement
Guest User

Untitled

a guest
Dec 10th, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.81 KB | None | 0 0
  1. 1<html>
  2. <head>
  3. <title>My calculator</title>
  4. <!-- <script type="text/javascript"> -->
  5. <script>
  6. function call(click_id)
  7. {
  8. var v1=parseFloat(document.getElementById("ip1").value);
  9. var v2=parseFloat(document.getElementById("ip2").value);
  10.  
  11. if(isNaN(v1) || isNaN(v2)) alert("enter a valid number");
  12.  
  13. else if(click_id=="add") document.getElementById("output").value=v1+v2;
  14.  
  15. else if(click_id=="sub") document.getElementById("output").value=v1-v2;
  16.  
  17. else if(click_id=="mul") document.getElementById("output").value=v1*v2;
  18.  
  19. else if(click_id=="div") document.getElementById("output").value=v1/v2; }
  20. </script>
  21. </head>
  22. <body>
  23. <center> <h1> A SIMPLE CALCULATOR PROGRAM</h1>
  24. <table style="background-color:yellow" align=="center">
  25. <tr>
  26. <td>
  27. <form method="get" action="">
  28. <div width=50% align="center">
  29. <label>OP1<input type="text" id="ip1"/></label>
  30. <label>op2<input type="text" id="ip2"/></label>
  31. <label>total<input type="text" id="output"/></label>
  32. </div>
  33. <br>
  34. <div width=50% align="center">
  35. <input type="button" value="+" id="add" onclick="call(this.id)"/>
  36. <input type="button" value="-" id="sub" onclick="call(this.id)"/>
  37. <input type="button" value="*" id="mul" onclick="call(this.id)"/>
  38. <input type="button" value="/" id="div" onclick="call(this.id)"/>
  39. <input type="reset" value="clear"/>
  40. </div>
  41. </form>
  42. </td>
  43. </tr>
  44. </table>
  45. </center>
  46. </body>
  47. </html>
  48. 2222222
  49. <html>
  50. <head>
  51. </head>
  52. <body>
  53. <table align="center" border=1>
  54. <tr><td>number</td><td>square</td><td>cube</td></tr>
  55. <!-- <script type="text/javascript"> -->
  56. <script>
  57. for(var n=0; n<=10; n++)
  58. {
  59. document.write( "<tr><td>" + n + "</td><td>" + n*n + "</td><td>" + n*n*n + "</td></tr>" ) ;
  60. }
  61.  
  62. </script>
  63. </table>
  64. </body>
  65. </html>
  66. 3333333333333
  67. <html>
  68. <body>
  69. <p id="demo"></p>
  70. <script>
  71. var var1 = setInterval(inTimer, 1000);
  72. var size = 5;
  73. var ids = document.getElementById("demo");
  74. function inTimer()
  75. {
  76. ids.innerHTML = 'TEXT GROWING';
  77. ids.setAttribute('style', "font-size: " + size + "px; color: red");
  78. size += 5;
  79. if(size >= 50 )
  80. {
  81. clearInterval(var1);
  82. var2 = setInterval(deTimer, 1000);
  83. }
  84. }
  85. function deTimer()
  86. { size -= 5;
  87. ids.innerHTML = 'TEXT SHRINKING';
  88. ids.setAttribute('style', "font-size: " + size + "px; color: blue");
  89. if(size == 5 )
  90. {
  91. clearInterval(var2);
  92. }
  93. }
  94. </script>
  95. </body>
  96. </html>
  97. 44444444444444
  98. <html>
  99. <head>
  100. <script>
  101. function findSolution()
  102. {
  103. findVowel();
  104. reverseNumber();
  105. }
  106.  
  107. function findVowel()
  108. {
  109. var str1;
  110.  
  111. str1 = document.getElementById('str1').value;
  112.  
  113. var i, ch, index;
  114. index = -1;
  115. for ( i = 0; i < str1.length; i++ )
  116. {
  117. ch = str1.charAt(i);
  118.  
  119. switch (ch) {
  120. case 'a' :
  121. case 'e' :
  122. case 'i' :
  123. case 'o' :
  124. case 'u' :
  125. case 'A' :
  126. case 'E' :
  127. case 'I' :
  128. case 'O' :
  129. case 'U' :
  130. index = i;
  131. break;
  132. }
  133. if ( index != -1 ) break;
  134. }
  135. if ( index == -1 )
  136. document.getElementById('result1').innerHTML = 'Vowel not found';
  137. else
  138. document.getElementById('result1').innerHTML = 'Location of first vowel : ' + index;
  139. }
  140.  
  141. function reverseNumber()
  142. {
  143. var str2;
  144. str2 = document.getElementById('str2').value;
  145. var i, ch, index, l;
  146. index = -1;
  147. var result2 = '';
  148. l = str2.length;
  149.  
  150. for ( i = 0; i < l; i++ )
  151. result2 = result2 + str2.charAt(l-i-1);
  152.  
  153. document.getElementById('result2').innerHTML = 'Number in reverse order : ' + result2;
  154. }
  155. </script>
  156. </head>
  157.  
  158. <body style='text-align: center'>
  159. <br>
  160. <br>
  161. <br>
  162. String 1 :
  163. <input type='text' id='str1' size='20' />
  164. <br>
  165. <br>
  166. String 2 :
  167. <input type='text' id='str2' size='20' />
  168. <br>
  169. <br>
  170. <input type='button' value='Submit' onclick='findSolution()' />
  171. <br>
  172. <br>
  173. <div id='result1'></div>
  174. <br>
  175. <br>
  176. <div id='result2'></div>
  177. </body>
  178. </html>
  179. 55555555555555
  180. <?xml-stylesheet type="text/css" href="6.css" ?>
  181. <!DOCTYPE HTML>
  182. <html>
  183. <head>
  184. <h1> STUDENTS DESCRIPTION </h1>
  185. </head>
  186. <students>
  187. <student>
  188. <USN>USN : 1CG15CS001</USN>
  189. <name>NAME : SANTHOS</name>
  190. <college>COLLEGE : CIT</college>
  191. <branch>BRANCH : Computer Science and Engineering</branch>
  192. <year>YEAR : 2015</year>
  193. <e-mail>E-Mail : santosh@gmail.com</e-mail>
  194. </student>
  195. <student>
  196. <USN>USN : 1CG15IS002</USN>
  197. <name>NAME : MANORANJAN</name>
  198. <college>COLLEGE : CITIT</college>
  199. <branch>BRANCH : Information Science and Engineering</branch>
  200. <year>YEAR : 2015</year>
  201. <e-mail>E-Mail : manoranjan@gmail.com</e-mail>
  202. </student>
  203. <student>
  204. <USN>USN : 1CG15EC101</USN>
  205. <name>NAME : CHETHAN</name>
  206. <college>COLLEGE : CITIT</college>
  207. <branch>BRANCH : Electronics and Communication Engineering
  208. </branch>
  209. <year>YEAR : 2015</year>
  210. <e-mail>E-Mail : chethan@gmail.com</e-mail>
  211. </student>
  212. </students>
  213. </html>
  214. 555555555555css
  215. student{
  216. display:block; margin-top:10px; color:Navy;
  217. }
  218. USN{
  219. display:block; margin-left:10px;font-size:14pt; color:Red;
  220. }
  221. name{
  222. display:block; margin-left:20px;font-size:14pt; color:Blue;
  223. }
  224. college{
  225. display:block; margin-left:20px;font-size:12pt; color:Maroon;
  226. }
  227. branch{
  228. display:block; margin-left:20px;font-size:12pt; color:Purple;
  229. }
  230. year{
  231. display:block; margin-left:20px;font-size:14pt; color:Green;
  232. }
  233. e-mail{
  234. display:block; margin-left:20px;font-size:12pt; color:Blue;
  235. 6666666666
  236. <?php
  237. print "<h3> REFRESH PAGE </h3>";
  238. $name="counter.txt";
  239. $file = fopen($name,"r");
  240. $hits= fscanf($file,"%d");
  241. fclose($file);
  242. $hits[0]++;
  243. $file = fopen($name,"w");
  244. fprintf($file,"%d",$hits[0]);
  245. fclose($file);
  246. print "Total number of views: ".$hits[0];
  247. ?>
  248. 777777777777
  249. l>
  250. <head>
  251. // <meta http-equiv="refresh" content="1"/>
  252. <style>
  253. p {
  254. color:white;
  255. font-size:90px;
  256. position: absolute;
  257. top: 50%;
  258. left: 50%;
  259. transform: translate(-50%, -50%);
  260. }
  261. body{
  262. background-color:black;
  263. }
  264. </style>
  265. <p> <?php
  266. date_default_timezone_set('Asia/Kolkata');
  267. $currentTime = date( ' h:i:s A', time () );
  268. echo $currentTime;
  269. ?> </p>
  270. </head>
  271. </html>
  272. 999999999999999
  273. <?php
  274. error_reporting(0);
  275. $states = array('Mississippi','Alabama','Texas','Massachusetts','Kansas');
  276. $stateList = array();
  277.  
  278. $arrlength = count($states);
  279.  
  280. // ends with xas
  281. for ( $x = 0; $x < $arrlength; $x++ )
  282. if ( strcmp(strrchr($states[$x],'xas'),'xas') == 0 )
  283. array_push($stateList,$states[$x]);
  284.  
  285. // Starts with K, ends with s
  286. for ( $x = 0; $x < $arrlength; $x++ )
  287. {
  288. $newstr = strtoupper($states[$x]);
  289. $revStr = strrev($newstr);
  290. if ( strcmp($newstr[0],"K") == 0 && strcmp($revStr[0],"S") == 0 )
  291. array_push($stateList,$states[$x]);
  292. }
  293.  
  294. // Starts with M ends with s
  295. for ( $x = 0; $x < $arrlength; $x++ )
  296. {
  297. $newStr = $states[$x];
  298. $revStr = strrev($states[$x]);
  299. if ( strcmp($newStr[0],"M") == 0 && strcmp($revStr[0],"s") == 0 )
  300. array_push($stateList,$states[$x]);
  301. }
  302.  
  303. // Ends with a
  304. for ( $x = 0; $x < $arrlength; $x++ )
  305. {
  306. $revStr = strrev($states[$x]);
  307. if ( strcmp($revStr[0],"a") == 0 )
  308. array_push($stateList,$states[$x]);
  309. }
  310.  
  311. for ( $x = 0; $x < count($stateList); $x++ )
  312. echo $stateList[$x]."\r\n";
  313. ?>
  314. 10101010101010
  315. <?php
  316. $host = 'localhost:3306';
  317. $username = 'root';
  318. $password = '';
  319. $dbName = '15cs553';
  320.  
  321. $connection = mysqli_connect($host,$username,$password,$dbName);
  322.  
  323. // Check connection
  324. if (mysqli_connect_errno())
  325. {
  326. echo "Failed to connect to database : " . mysqli_connect_error();
  327. }
  328. else
  329. echo "<h1 style='text-align: center'>Connection successful ...</h1>".'<br>';
  330.  
  331. $sql = "select * from students order by usn";
  332. $resultSet = $connection->query($sql);
  333.  
  334. if ( $resultSet->num_rows > 0)
  335. {
  336. echo "<table border='1' style='margin: auto' >";
  337. echo "<tr><th>USN</th><th>Name</th></tr>";
  338. while($row = $resultSet->fetch_assoc())
  339. {
  340. echo "<tr>";
  341. echo "<td>".$row["usn"]."</td>";
  342. echo "<td>".$row["name"]."</td>";
  343. echo "</tr>";
  344. }
  345. echo "</table>";
  346. }
  347.  
  348. $resultSet->close();
  349. $connection->close();
  350. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement