Guest User

Untitled

a guest
Nov 9th, 2017
29
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 16.96 KB | None | 0 0
  1. 1. TimE TablE
  2. ----------------------
  3. <html>
  4. <head>
  5. <link rel="stylesheet" href="ttcss.css">
  6. </head>
  7. <body>
  8.  
  9. <table allign="center" border=10px width="80%" height="60%">
  10.  
  11. <tr>
  12. <th>Monday</th>
  13. <th>Tuesday</th>
  14. <th>WEdnesday</th>
  15. <th>Monday</th>
  16. <th>Tuesday</th>
  17. <th>WEdnesday</th>
  18. </tr>
  19.  
  20. <tr class="1a">
  21. <th>9:30-10:30</th>
  22. <td>AI</td>
  23. <td>CN</td>
  24. <td>AI</td>
  25. <td>CN</td>
  26. <td>AI</td>
  27. </tr>
  28.  
  29. <tr>
  30. <th>9:30-10:30</th>
  31. <td>AI</td>
  32. <td>CN</td>
  33. <td>AI</td>
  34. <td>CN</td>
  35. <td>AI</td>
  36. </tr>
  37.  
  38. <tr>
  39. <th>9:30-10:30</th>
  40. <td>AI</td>
  41. <td>CN</td>
  42. <td>AI</td>
  43. <td>CN</td>
  44. <td>AI</td>
  45. </tr>
  46.  
  47. <tr>
  48. <th>9:30-10:30</th>
  49. <td colspan="3">dgsgg</td>
  50. <td>AI</td>
  51.  
  52. <td>AI</td>
  53. </tr>
  54.  
  55. <tr>
  56. <th>9:30-10:30</th>
  57. <td>AI</td>
  58. <td>CN</td>
  59. <td>AI</td>
  60. <td>CN</td>
  61. <td>AI</td>
  62. </tr>
  63. </table>
  64. </body>
  65. </html>
  66. --------------------------------
  67.  
  68. 2. ARticle
  69.  
  70. ARTICLE ,HEADER, FOOTER
  71. <!DOCTYPE html>
  72. <html>
  73. <title>HTML5</title>
  74. <meta charset="utf-8">
  75. <style>body
  76. { font-family:Verdana,sans-serif;
  77. font-size:0.8em;
  78. }
  79. aside
  80. {
  81. float:right;
  82. height:620;
  83. width:300;
  84. border:1px solid; margin:5px;
  85. margin-bottom:15px;
  86. padding:8px;
  87. background-color:white; }
  88. header,footer,section,article
  89. {
  90. border:1px solid grey;
  91. margin:5px;margin-bottom:15px;padding:8px;
  92. background-color:white;
  93. }header,footer
  94. { color:white;background-color:#444;margin-bottom:5px; }article{ width:700px;
  95. }
  96. section
  97. { background-color:#ddd; }
  98. nav ul
  99. { margin:0;padding:0;
  100. }nav ul
  101. li
  102. {
  103. display:inline;
  104. margin:5px;
  105. }
  106. </style>
  107. <body>
  108. <header><h1>Monday Times</h1>
  109. </header>
  110. <nav><ul>
  111. <li>Time Table</li>
  112. <li>Course</li> </ul></nav>
  113.  
  114. <section><h2>News Section</h2>
  115. <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>
  116. to<br>
  117. NCJ<br>
  118.  
  119. </aside>
  120. <article><h2>News Article1</h2><p>
  121. <table border=1>
  122. <tr>
  123. <th>9.30</th>
  124. <th>10.30</th>
  125. <th>11.30</th>
  126. <th>12.30</th>
  127. </tr>
  128. <tr>
  129. <th>AI</th>
  130. <th>IT</th>
  131. <th>OOAD</th>
  132. <th>ADA</th></tr>
  133. <tr>
  134. <th>OOAD</th>
  135. <th>IT</th>
  136. <th>ADA</th>
  137. <th>AI</th>
  138. </tr>
  139. <tr>
  140. <th>IT</th>
  141. <th>AI</th>
  142. <th>OOAD</th>
  143. <th>ADA</th>
  144. </tr>
  145. </table>
  146. </p>
  147. </article>
  148. <article>
  149. <h2>News Article
  150. </h2>
  151. <p>.BCA<br>
  152. .B.Sc<br>
  153. .BA<br>
  154. .B.Com<br>
  155. </P><P>M.Sc<br>
  156. .COMPUTER SCIENCE<br>
  157. .PHYSICS<br>
  158. .MATHS<br>
  159. </article>
  160. </section>
  161. <footer><p>&copy; 2015 National College Jayanagar. All rights reserved.</p>
  162. </footer>
  163. </body>
  164. </html>
  165. -------------------------------
  166. 3. MArquee
  167.  
  168.  
  169. <!DOCTYPE html>
  170. <html>
  171. <head>
  172.  
  173. <title>Insert title here</title>
  174.  
  175. <style type="text/css">
  176.  
  177. img{opacity:0.5;}
  178.  
  179. marquee
  180. {
  181. height:100%;
  182. bottom:0;
  183. width:200px;
  184. float:right;
  185. }
  186.  
  187.  
  188. img:hover
  189. {opacity:1}
  190.  
  191. li{
  192. color:purple;
  193. font-family:Algerian;
  194. }
  195. </style>
  196.  
  197. </head>
  198.  
  199. <body>
  200.  
  201. <marquee onmouseover="stop()" onmouseout="start()" scrollamount="2" direction="up" behavior="scroll">
  202.  
  203. <img src="C:\Users\HARI\Desktop\aa.jpg"><br>
  204. <img alt="IMG2" width=100 height=100 src="C:\Users\HARI\Desktop\aa.jpg"><br>
  205.  
  206. <img alt="IMG3" width=100 height=100 src="C:\Users\HARI\Desktop\aa.jpg"><br>
  207. <img alt="IMG4" width=100 height=100 src="C:\Users\HARI\Desktop\aa.jpgs"><br>
  208.  
  209. <img alt="IMG5" width=100 height=100 src="Koala.jpg">
  210.  
  211. </marquee>
  212.  
  213. <header> LIST OF IMAGES DISPLAYED</header>
  214.  
  215. <ol>
  216. <li>BLUE HILLS</li>
  217. <li>SUN SET</li>
  218. <li>LILLIES</li>
  219. <li>WINTER</li>
  220. </ol>
  221.  
  222. </body>
  223.  
  224. </html>
  225. ------------------------------
  226. 4. Calc
  227.  
  228. <!DOCTYPE html>
  229. <html>
  230. <head>
  231. <meta charset="ISO-8859-1">
  232. <title> WHATEVER U FEEL SO </title>
  233. <script>
  234. var plus,minus,divide,prod,mod;
  235.  
  236. function calculate()
  237. {
  238. plus=document.calc.operator.options[0];
  239. minus=document.calc.operator.options[1];
  240. divide=document.calc.operator.options[2];
  241. prod=document.calc.operator.options[3];
  242. mod=document.calc.operator.options[4];
  243.  
  244. var fir=document.calc.val1.value;
  245. var sec=document.calc.val2.value;
  246.  
  247. if((fir==null)||(fir==""))
  248. { {
  249. alert("enter first number");
  250. fir.focus()
  251. }
  252. }
  253. if((sec==null)||(sec==""))
  254. {
  255. alert("enter second number")
  256. sec.focus()
  257. }
  258. x=parseInt(document.calc.val1.value)
  259. y=parseInt(document.calc.val2.value)
  260. if(plus.selected)
  261. document.calc.answer.value=x+y
  262. if(minus.selected)
  263. document.calc.answer.value=x-y
  264. if(divide.selected)
  265. document.calc.answer.value=x/y
  266. if(prod.selected)
  267. document.calc.answer.value=x*y
  268. if(mod.selected)
  269. document.calc.answer.value=x%y
  270. }
  271. </script>
  272. </head>
  273. <body>
  274. <h2>Calculator</h2>
  275. <form name="calc" >
  276. <input type=text name=val1 size=10>
  277. <select name=operator>
  278. <option value=plus>+
  279. <option value=minus>-
  280. <option value=divide>/
  281. <option value=prod>*
  282. <option value =mod>%
  283. </select>
  284. <input type=text name=val2 size=10>
  285. <input type=text name=answer size=10>
  286. <input type=button value=ans onClick="calculate()">
  287. </form>
  288. </body>
  289. </html>
  290. ---------------------------------------
  291. 5. sort
  292.  
  293. <!DOCTYPE html>
  294. <html>
  295. <head>
  296. <meta charset="ISO=8859-1">
  297. <title>insert title here</title>
  298. </head>
  299. <body>
  300.  
  301. <p>sort a set of names
  302. <script>
  303. var i=0,j,temp,n
  304. var names=new Array()
  305.  
  306. n=prompt("enter new name,or OK to end"," ")
  307. while(n != "")
  308. {
  309. document.write("<br>" + n)
  310. names[names.length] = n
  311. n=prompt("enter new name,or OK to end","")
  312. }
  313. document.write("<p>"+names.length+"names")
  314.  
  315. for(i=0;i<names.length-1;i++)
  316. {
  317. for(j=i+1;j<names.length;j++)
  318. {
  319. if(names[i]>names[j])
  320. {
  321. temp = names[i]
  322. names[i] = names[j]
  323. names[j] = temp
  324. }
  325. }
  326. }
  327.  
  328. for(i=0;i<names.length;i++)
  329. document.write("<br>"+names[i]);
  330. </script>
  331. </body>
  332. </html>
  333. -----------------------------------
  334. 6. results stds
  335.  
  336. <!DOCTYPE html>
  337. <html>
  338. <head>
  339. <script language="javascript">
  340. function cal()
  341. {
  342. var m1,m2,m3,m4,avg=0,total=0,result="",grade="";
  343. m1=parseInt(document.student.s1.value);
  344. m2=parseInt(document.student.s2.value);
  345. m3=parseInt(document.student.s3.value);
  346. m4=parseInt(document.student.s4.value);
  347.  
  348. total=m1+m2+m3+m4;
  349. avg=total/4;
  350. alert(avg);
  351. if(m1<35||m2<35||m3<35||m4<35)
  352. {
  353. result="fail";
  354. grade="D";
  355. }
  356. else if(avg>=75)
  357. {
  358. result="distinction";
  359. grade="A+";
  360. }
  361. else if(avg>=60||avg<75)
  362. {
  363. result="first class";
  364. grade="A"
  365. }
  366. else if(avg>=50||avg<60)
  367. {
  368. result="second class";
  369. grade="B";
  370. }
  371. else if(avg>=35||avg<50)
  372. {
  373. result="pass class";
  374. grade="C";
  375. }
  376. else if(avg<35)
  377. {
  378. result="fail";
  379. grade="D";
  380. }
  381. document.student.result.value=result;
  382. document.student.grade.value=grade;
  383. document.student.total.value=total;
  384. document.student.avg.value=avg;
  385. }
  386. </script>
  387. </head>
  388. <body>
  389. <h2><center>Result calculation for a student</center></h2><br/>
  390. <center><form name="student" method="get" action="">
  391. Name &nbsp
  392. <input type="text" name="name" id="t1" value=""><br/><br/>
  393. class &nbsp;&nbsp
  394. <input type="text" name="cls" id="t2" value=""><br/><br/>
  395. sub1 &nbsp;&nbsp
  396. <input type="text" name="s1" id="t3" value=""><br/><br/>
  397. sub2 &nbsp;&nbsp
  398. <input type="text" name="s2" id="t4" value=""><br/><br/>
  399. sub3 &nbsp;&nbsp
  400. <input type="text" name="s3" id="t5 value=""><br/><br/>
  401. sub4 &nbsp;&nbsp
  402. <input type="text" name="s4" id="t6" value=""><br/><br/>
  403. <input type="button" onclick="cal()" value="calculate">
  404. <br/><br/><br/>total &nbsp;&nbsp
  405. <input type="text" name="total" id="t7" value=""><br/><br/>
  406. average
  407. <input type="text" name="avg" id="t8" value=""><br/><br/>
  408. result &nbsp;&nbsp
  409. <input type="text" name="result" id="t9" value=""><br/><br/>
  410. grade &nbsp;&nbsp
  411. <input type="text" name="grade" id="t10" value=""><br/><br/>
  412. </form></center>
  413. </body>
  414. </html>
  415. ------------------------------
  416. 7. Fibo n sqrt
  417.  
  418. <html>
  419. <head>
  420. <title>Insert title here</title>
  421. <script type="text/javascript">
  422. function sqr()
  423. {
  424. var n=prompt("enter a positive value for n","");
  425. while(n<=0)
  426. {
  427. alert("enter positive value");
  428. n=prompt("enter positive value for n"," ");
  429. }
  430. var sq="numbers and their square \n";
  431. document.write("numbers and their square values using alert <br />");
  432. for(i=1;i<=n;i++)
  433. {
  434. sq=(sq+i+"==>"+i*i+"\n");
  435. }
  436. alert(sq);
  437. }
  438.  
  439. function fib()
  440. {
  441. var a=0;
  442. var b=1;
  443. var c,i;
  444. var str;
  445. var n=prompt("enter a number"," ");
  446. while(n<=0)
  447. {
  448. alert("enter the nos");
  449. n=prompt("enter a number"," ");
  450. }
  451. document.write("fibonacci series<br />");
  452. str=a+"\n"+b;
  453. for(i=0;i<n-2;i++)
  454. {
  455. c=a+b;
  456. str=(str+"\n"+c);
  457. a=b;
  458. b=c;
  459. }
  460. alert(str);
  461. }
  462. </script>
  463. </head>
  464. <body>
  465. <form >
  466. <h1>Click on the button to calculate the Square of a series or Fib of a number</h1>
  467. <input type="submit" name="S" value="SQUARE" onclick="sqr()">
  468. <input type="submit" name="S1" value="FIBO" onclick="fib()">
  469. </form>
  470. </body>
  471. </html>
  472. -----------------------------------
  473. 8. Php login
  474.  
  475. Php prgm
  476.  
  477.  
  478. <!DOCTYPE html>
  479.  
  480.  
  481. <html>
  482.  
  483.  
  484. <head>
  485.  
  486.  
  487. <meta charset="ISO-8859-1">
  488.  
  489.  
  490. <title>insert title here</title>
  491.  
  492.  
  493. </head>
  494.  
  495.  
  496. <body>
  497.  
  498.  
  499. <h1>login page</h1>
  500.  
  501.  
  502. <form action ="LOGO.php" method="post">
  503.  
  504.  
  505. user name:<input type="text" name="uname">
  506.  
  507.  
  508. password:<input type=text" name="pass">
  509.  
  510.  
  511. <input type="submit" value="login">
  512.  
  513.  
  514. </form>
  515.  
  516.  
  517. </body>
  518.  
  519.  
  520. </html>
  521.  
  522.  
  523.  
  524.  
  525. php file
  526.  
  527.  
  528.  
  529.  
  530.  
  531. <?php
  532.  
  533.  
  534. $username="root";
  535.  
  536.  
  537. $password="";
  538.  
  539.  
  540. $database="login";
  541.  
  542.  
  543.  
  544.  
  545. $first=$_POST["uname"];
  546.  
  547.  
  548. $pa=$_POST["pass"];
  549.  
  550.  
  551. $con=mysql_connect("localhost",$username,$password);
  552.  
  553.  
  554. mysql_select_db("login",$con);
  555.  
  556.  
  557.  
  558.  
  559. $query="select * from log";
  560.  
  561. $result=mysql_query($query);
  562.  
  563.  
  564.  
  565.  
  566. $f=1;
  567.  
  568.  
  569. while($row=mysql_fetch_array($result))
  570.  
  571.  
  572. {
  573.  
  574.  
  575. if($row['uname']==$first && $row['pass']==$pa)
  576.  
  577.  
  578.  
  579. {
  580.  
  581.  
  582.  $f=2;
  583.  
  584.  
  585. }
  586.  
  587.  
  588. }
  589.  
  590.  
  591. if($f==1)
  592.  
  593.  
  594. {
  595.  
  596.  
  597.  echo "login not correct";
  598.  
  599.  
  600. }
  601.  
  602.  
  603. else
  604.  
  605.  
  606. {
  607.  
  608.  
  609.  echo "correct";
  610.  
  611.  
  612.  header("location:success.html");
  613.  
  614.  
  615. }
  616.  
  617.  
  618. mysql_close();
  619.  
  620.  
  621. ?>
  622.  
  623.  
  624.  
  625. success page
  626.  
  627.  
  628.  
  629. <!DOCTYPE html>
  630.  
  631.  
  632. <html>
  633.  
  634.  
  635. <head>
  636.  
  637.  
  638. <meta charset="ISO-8859-1">
  639.  
  640. </html>
  641.  
  642. <body>
  643.  
  644. <h1>success
  645.  
  646. <br>
  647.  
  648. login correct</h1>
  649.  
  650.  
  651. </body>
  652.  
  653.  
  654. </html>
  655. ------------------------------------
  656. 9. Bank transaction
  657.  
  658. <html>
  659. <head>
  660.  
  661. <title>Insert title here</title>
  662. </head>
  663. <body>
  664. <form action="Bank_log.php" method="post">
  665. you Number:<input type="text" name="acc"><br>
  666. Pin :<input type="number" name="pin">
  667. <input type="submit" name="check" value="check">
  668. </form>
  669. </body>
  670. </html>
  671.  
  672. login php
  673.  
  674.  
  675.  
  676. <?php
  677. $username="root";
  678. $password="";
  679. $database="bankdb";
  680.  
  681. $first=$_POST["acc"];
  682. $pa=$_POST["pin"];
  683.  
  684.  
  685. session_start();
  686. $_SESSION['myValue']=$first;
  687. $con = mysql_connect("localhost",$username,$password);
  688. mysql_select_db("bankdb",$con);
  689.  
  690. $query = "select * from bank1";
  691. $result=mysql_query($query);
  692.  
  693. $f=1;
  694. while($row = mysql_fetch_array($result))
  695. {
  696. if($row['acc'] == $first && $row['pin'] == $pa)
  697. {
  698. $f=0;
  699. header("location:Bank_Wit.html");
  700.  
  701. }
  702. }
  703. if($f==1)
  704. {
  705. echo "login incorrect";
  706. }
  707.  
  708. mysql_close();
  709. ?>
  710.  
  711. operation html
  712.  
  713. <!DOCTYPE html>
  714. <html>
  715. <head>
  716. <meta charset="ISO-8859-1">
  717. <title>Insert title here</title>
  718. </head>
  719. <body>
  720. <form action="Bank_updat.php" method="post">
  721. <select name="sel">
  722. <option>Withdraw</option>
  723. <option>Deposit</option>
  724.  
  725.  
  726. </select>
  727. Enter ur amount:<input type="text" name="amt">
  728. <input type="submit" name="sub" value="update">
  729.  
  730. </form>
  731. </body>
  732. </html>
  733.  
  734. update php
  735.  
  736.  
  737.  
  738.  
  739.  
  740. <?php
  741. $username="root";
  742. $password="";
  743. $database="bankdb";
  744.  
  745. $wit=$_POST["sel"];
  746. $amt=$_POST["amt"];
  747. $con = mysql_connect("localhost",$username,$password);
  748. mysql_select_db("bankdb",$con);
  749.  
  750. session_start();
  751. $a= $_SESSION['myValue'];
  752.  
  753. $query = "select * from bank1";
  754. $result=mysql_query($query);
  755. $am=0;
  756. $f=1;
  757. while($row = mysql_fetch_array($result))
  758. {
  759. if($row['acc']==$a)
  760. {
  761. if ($wit=="Withdraw" )
  762. {
  763.  
  764. $am=$row['amt']-$amt;
  765. echo"record updated";
  766. }
  767. if ($wit=="Deposit")
  768. {
  769. $am=$row['amt']+$amt;
  770. echo "record add";
  771. }
  772. }
  773. }
  774. $query="update bank1 set amt='$am' where acc='$a' ";
  775. $result=mysql_query($query);
  776.  
  777. mysql_close();
  778. ?>
  779. ---------------------------------
  780. 10. Cookies
  781.  
  782. <!DOCTYPE html>
  783. <html>
  784. <head>
  785. <meta charset="ISO-8859-1">
  786. <title>Insert title here</title>
  787. </head>
  788. <body>
  789. <form method='post' action='cookies_sess.php'>
  790.  
  791. To: (Email) <br />
  792. <input type='text' name='recipient' size='35' />
  793. <p />
  794.  
  795. Subject: <br />
  796. <input type='text' name='topic' size ='35' />
  797. <br />
  798. Mail Message:
  799. <br />
  800. <textarea name='message' rows='4' cols='40'></textarea>
  801.  
  802. <br />
  803. <input type='submit' value='Send Message' />
  804. <br />
  805. </form>
  806.  
  807. </body>
  808. </html>
  809.  
  810. php
  811.  
  812. <?php
  813. $intime=60*60*24+time();
  814. setcookie('lastvisit',date("G:i -m/d/y"),$intime);
  815. if(isset($_COOKIE['lastvisit']))
  816. {
  817. $visit=$_COOKIE['lastvisit'];
  818. echo "you last visit was",$visit;
  819. }
  820. else
  821. echo"cookies expired";
  822.  
  823.  
  824. session_start();
  825. if(isset($_SESSION["vie"]))
  826. $_SESSION["vie"]=$_SESSION["vie"]+1;
  827. else
  828. $_SESSION['vie']=1;
  829. echo" page views=",$_SESSION["vie"];
  830. ?>
  831. --------------------------------------
  832. 11. form validation
  833.  
  834. <!DOCTYPE html>
  835.  
  836. <html>
  837.  
  838. <head>
  839.  
  840. <meta charset="ISO-8859-1">
  841.  
  842. <title>Insert title here</title>
  843.  
  844. <script type="text/javascript">
  845.  
  846. function val()
  847.  
  848. {
  849.  
  850. var nam=document.fname.nam;
  851.  
  852. var pas=document.fname.pass;
  853.  
  854. var pas1=document.fname.rpass;
  855.  
  856. var em=document.fname.email;
  857.  
  858. var no=document.fname.mno;
  859.  
  860. var dob=document.fname.db;
  861.  
  862.  
  863.  
  864. if(nam.value==""||nam.value==null)
  865.  
  866. {
  867.  
  868. alert("Name Should not be empty");
  869.  
  870. nam.focus();
  871.  
  872. nam.style.background = 'Yellow';
  873.  
  874.  
  875.  
  876. return false;
  877.  
  878. }
  879.  
  880. nam.style.background = 'white';
  881.  
  882. if(pas.value==""||pas1.value=="")
  883.  
  884. {
  885.  
  886. alert("password must not be empty");
  887.  
  888. return false;
  889.  
  890. }
  891.  
  892.  
  893.  
  894. if(pas.value!=pas1.value)
  895.  
  896. {
  897.  
  898. alert("Password must match");
  899.  
  900. pas1.value="";
  901.  
  902. pas1.focus();
  903.  
  904. pas1.style.background = 'Yellow';
  905.  
  906. return false;
  907.  
  908.  
  909.  
  910. }
  911.  
  912.  
  913.  
  914. if(no.value.length != 10)
  915.  
  916. {
  917.  
  918. alert("enter 10 digit number");
  919.  
  920. no.focus();
  921.  
  922. no.style.background = 'Yellow';
  923.  
  924. return false;
  925.  
  926. }
  927.  
  928. var dt=new Date();
  929. alert(dt);
  930.  
  931. var mon=dt.getMonth()-1;
  932.  
  933. var day=dt.getDate();
  934.  
  935. var year=dt.getFullYear();
  936.  
  937.  
  938.  
  939. var d=dob.value.slice(0,4);
  940.  
  941. var m=dob.value.slice(5,7);
  942.  
  943. var y=dob.value.slice(8,10);
  944.  
  945.  
  946.  
  947. if((parseInt(y)<day)||(parseInt(m)<mon)||(parseInt(d)<day))
  948.  
  949. {
  950.  
  951. alert ("invalid date");
  952.  
  953. dob.focus();
  954.  
  955. dob.style.background = 'Yellow';
  956.  
  957. return false;
  958.  
  959. }
  960.  
  961.  
  962.  
  963. return true;
  964.  
  965. }
  966.  
  967. </script>
  968.  
  969.  
  970.  
  971. </head>
  972.  
  973. <body>
  974.  
  975. <form name="fname" action="welcome.html" onsubmit="return val()">
  976.  
  977. <h2>Ticket Booking:<br></h2>
  978.  
  979. <table>
  980.  
  981. <tr><th>
  982.  
  983. Enter your Name: </th><td><input type="text" name="nam"><br></td>
  984.  
  985. </tr>
  986.  
  987. <tr><th>
  988.  
  989. Enter the Password: </th><td> <input type="password" name="pass"><br></td></tr>
  990.  
  991. <tr><th>
  992.  
  993. Re enter the password: </th><td> <input type="password" name="rpass"><br></td></tr>
  994.  
  995.  
  996.  
  997. <tr><th>
  998.  
  999. E-mail: </th><td> <input type="email" name="email"><br></td></tr>
  1000.  
  1001. <tr><th>
  1002.  
  1003.  
  1004.  
  1005. <tr><th>Mobile Number: </th><td><input type="number" name="mno"><br></td></tr>
  1006.  
  1007. <tr><th>No of Tickets:</th><td> <select>
  1008.  
  1009. <option>1</option>
  1010.  
  1011. <option>2</option>
  1012.  
  1013. <option>3</option>
  1014.  
  1015. <option>4</option>
  1016.  
  1017. <option>5</option>
  1018.  
  1019. <option>6</option>
  1020.  
  1021. </select><br></td></tr>
  1022.  
  1023. <tr><th>
  1024.  
  1025. Date: </th><td> <input type="date" name="db"><br></td></tr>
  1026.  
  1027. <tr><th rowspan="2"><input type="submit" name="sub" value="Book"><br></th></tr>
  1028.  
  1029. </table>
  1030.  
  1031. </form>
  1032.  
  1033. </body>
  1034.  
  1035. </html>
  1036. --------------------------------------
  1037. 12. book
  1038.  
  1039. <html>
  1040. <body>
  1041. <?php
  1042. $username="root";
  1043. $password="";
  1044. $database="bookdb";
  1045. $con = mysql_connect("localhost",$username,$password);
  1046. $db=mysql_select_db("bookdb",$con);
  1047. $query = "select bname from book";
  1048. $result=mysql_query($query);
  1049. ?>
  1050. <form method="post" action="bookdisp.php">
  1051. search:<select name=sel>
  1052. <?php
  1053. while ($row = mysql_fetch_array($result))
  1054. {
  1055. ?>
  1056. <option><?php echo $row['bname'];?>
  1057. </option>
  1058. <?php }?>
  1059. </select>
  1060. <input type="submit" value="search">
  1061. </form>
  1062. <?php
  1063. mysql_close();
  1064. ?>
  1065. </body></html>
  1066.  
  1067.  
  1068.  
  1069.  
  1070. <?php
  1071. $username="root";
  1072. $password="";
  1073. $database="bookdb";
  1074.  
  1075. $selval=$_POST["sel"];
  1076.  
  1077. $con = mysql_connect("localhost",$username,$password);
  1078. mysql_select_db("bookdb",$con);
  1079.  
  1080. $query = "select * from book where bname='$selval'";
  1081. $result=mysql_query($query);
  1082. echo "<table border=1><tr><th>BOOKID</th>
  1083.  
  1084. <th>BOOKNAME</th><th>BOOKpublisher</th><th>BOOKNumber</th></tr>";
  1085.  
  1086. $row = mysql_fetch_array($result);
  1087.  
  1088.  
  1089. echo "<tr><td>",$row['bookid'] ,"</td><td> ", $row['bname']," </td><td>", $row['bpublisher']," </td><td>", $row['bnumber'],"</td><tr></table><br>";
  1090.  
  1091.  
  1092.  
  1093. mysql_close();
  1094. ?>
Add Comment
Please, Sign In to add comment