Advertisement
Guest User

Untitled

a guest
May 19th, 2019
181
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.46 KB | None | 0 0
  1. INDEX.PHP
  2.  
  3. <!doctype html>
  4. <html>
  5. <head>
  6. <meta charset="utf-8">
  7.  
  8. <title>Untitled
  9.  
  10.  
  11.  
  12. Document</title>
  13. <link href="style.css" rel="stylesheet" type="text/css">
  14. </head>
  15.  
  16. <body>
  17. <div id="TopsPart">
  18.  
  19. <div id="LogoPart">
  20. <img src="images/US_Cellular_logo_logotype.png" width="200px" alt="">
  21.  
  22. </div>
  23. <div id="NavPart">
  24.  
  25. <menu>
  26. <li><a href="index.php">home</a></li>
  27. <li><a href="insert.php">insert</a></li>
  28. <li><a href="select.php">select</a></li>
  29.  
  30. <li><a href="update.php">update</a></li>
  31. <li><a href="delete.php">delete</a></li>
  32.  
  33.  
  34. </menu>
  35.  
  36.  
  37.  
  38. </div>
  39. <div id="BannerPart">
  40. Document</title>
  41. <link href="style.css" rel="stylesheet" type="text/css">
  42. </head>
  43.  
  44. <body><?php
  45.  
  46. include('slider.html');
  47.  
  48. ?>
  49.  
  50. </div>
  51.  
  52.  
  53. </div>
  54.  
  55. <div id="ContentPart"></div>
  56.  
  57. <div id="FooterPart">
  58. <table width="100%" border="0" style="color:white; text-align:center;">
  59. <tbody>
  60. <tr>
  61. <td>Adress: <br> Duhok</td>
  62. <td>Phone: <br>123456789</td>
  63. <td><img src="images/DSC_0125.JPG" width="15px" </td>
  64. </tr>
  65. <tr>
  66. <td>&nbsp;</td>
  67. <td>Newros uni.</td>
  68. <td>&nbsp;</td>
  69. </tr>
  70. </tbody>
  71. </table>
  72.  
  73.  
  74. </div>
  75.  
  76.  
  77. </body>
  78. </html>
  79.  
  80. ------------------------------------------------------------
  81. CONFIG.PHP
  82.  
  83. <?php
  84. $con=mysqli_connect("localhost","root","","lasttest");
  85.  
  86. if(!$con){
  87. echo"Error";
  88. }
  89.  
  90.  
  91. ?>
  92.  
  93. ----------------------------------------------------
  94.  
  95. INSERT.PHP
  96.  
  97.  
  98. <!doctype html>
  99. <html>
  100. <head>
  101. <meta charset="utf-8">
  102. <title>Untitled Document</title>
  103. <link href="style.css" rel="stylesheet" type="text/css">
  104. </head>
  105.  
  106. <body>
  107.  
  108.  
  109. <div id="TopsPart">
  110.  
  111. <div id="LogoPart">
  112. <img src="images/US_Cellular_logo_logotype.png" width="200px" alt="">
  113.  
  114. </div>
  115. <div id="NavPart">
  116.  
  117. <menu>
  118. <li><a href="index.php">home</a></li>
  119. <li><a href="insert.php">insert</a></li>
  120. <li><a href="select.php">select</a></li>
  121. <li><a href="update.php">update</a></li>
  122. <li><a href="delete.php">delete</a></li>
  123.  
  124.  
  125. </menu>
  126.  
  127.  
  128.  
  129. </div>
  130. <div id="BannerPart">
  131. <?php
  132.  
  133. include('slider.html');
  134.  
  135. ?>
  136.  
  137. </div>
  138.  
  139.  
  140. </div>
  141.  
  142. <div id="ContentPart">
  143. <br>
  144. <form method="POST">
  145.  
  146.  
  147. <table width="300" border="1" align="center">
  148. <tbody>
  149. <tr>
  150. <td>Name:</td>
  151. <td><input type="text" id="name" name="name"</td>
  152. </tr>
  153. <tr>
  154. <td>Date:</td>
  155. <td><input type="text" name="date" id="date"></td>
  156. </tr>
  157. <tr>
  158. <td>Info:</td>
  159. <td><input type="text" name="info" id="info"></td>
  160. </tr>
  161. <tr>
  162. <td colspan="2" align="center"><input type="submit" name="submit" id="submit"></td>
  163.  
  164. </tr>
  165.  
  166. </tbody>
  167. </table>
  168. </form>
  169.  
  170. </div>
  171.  
  172. <div id="FooterPart">
  173. <table width="100%" border="0" style="color:white; text-align:center;">
  174. <tbody>
  175. <tr>
  176. <td>Adress: <br> Duhok</td>
  177. <td>Phone: <br>123456789</td>
  178. <td><img src="images/DSC_0125.JPG" width="15px" </td>
  179. </tr>
  180. <tr>
  181. <td>&nbsp;</td>
  182. <td>Newros uni.</td>
  183. <td>&nbsp;</td>
  184. </tr>
  185. </tbody>
  186. </table>
  187.  
  188.  
  189. </div>
  190.  
  191.  
  192. </body>
  193. </html>
  194.  
  195.  
  196. <?php
  197.  
  198. include "config.php";
  199.  
  200. if(isset($_REQUEST['submit'])){
  201.  
  202.  
  203. $name=$_POST['name'];
  204. $date=$_POST['date'];
  205. $info=$_POST['info'];
  206. $insert= "INSERT INTO lasttest_tbl (Name,Date,Info) VALUES ('$name','$date','$info')";
  207.  
  208. if(mysqli_query($con,$insert)){
  209. echo "Inserted";
  210.  
  211.  
  212.  
  213. }
  214. else{
  215. echo "not inserted";
  216. }
  217.  
  218. }
  219.  
  220.  
  221.  
  222.  
  223. ?>
  224.  
  225.  
  226.  
  227.  
  228.  
  229.  
  230. UPDATE.PHP
  231.  
  232. -----------------------------------------------------
  233. <!doctype html>
  234. <html>
  235. <head>
  236. <meta charset="utf-8">
  237. <title>Untitled Document</title>
  238. <link href="style.css" rel="stylesheet" type="text/css">
  239. </head>
  240. <body>
  241.  
  242. <?php
  243. include "config.php";
  244. ?>
  245. <br>
  246. <div id="TopPart">
  247.  
  248. <div id="LogoPart">
  249.  
  250. <img src="images/US_Cellular_logo_logotype.png" width="200px" alt="">
  251.  
  252. </div>
  253.  
  254. <div id="NavPart">
  255.  
  256. <menu>
  257. <li><a href="index.php">Home</a></li>
  258. <li><a href="insert.php">Insert</a></li>
  259. <li><a href="select.php">Select</a></li>
  260. <li><a href="update.php">Update</a></li>
  261. <li><a href="delete.php">Delete</a></li>
  262.  
  263. </menu>
  264.  
  265. </div>
  266. <div id="BannerPart">
  267.  
  268. <?php
  269. include "slider.html";
  270. ?>
  271.  
  272. </div>
  273. </div>
  274.  
  275. <div id="ContentPart">
  276.  
  277. <?php
  278.  
  279. include "config.php";
  280. $select = "SELECT * FROM lasttest_tbl";
  281. $result = mysqli_query($con,$select);
  282.  
  283. echo "<table border=1>";
  284. echo "<tr>";
  285. echo "<td> ID </td>";
  286. echo "<td> Name </td>";
  287. echo "<td> Date </td>";
  288. echo "<td> Info </td>";
  289. echo "</tr>";
  290.  
  291. while($row = mysqli_fetch_array($result)){
  292. echo "<tr>";
  293. echo "<td>" . $row['id'] . "</td>";
  294. echo "<td>" . $row['Name'] . "</td>";
  295. echo "<td>" . $row['Date'] . "</td>";
  296. echo "<td>" . $row['Info'] . "</td>";
  297. echo "</tr>";
  298.  
  299. }
  300.  
  301. echo "</table>";
  302.  
  303.  
  304. ?>
  305.  
  306. <br>
  307. <br>
  308.  
  309. <form method="post">
  310.  
  311. <input type="text" name="name">
  312. <input type="text" name="newname">
  313. <input type="submit" name="submit">
  314.  
  315. <?php
  316.  
  317. include "config.php";
  318.  
  319.  
  320.  
  321. if(isset($_REQUEST['submit'])){
  322.  
  323. $oldname = $_POST['name'];
  324. $newname = $_POST['newname'];
  325.  
  326. $update = "UPDATE lasttest_tbl SET name='". $newname."' WHERE name = '". $oldname . "' ";
  327.  
  328. if(mysqli_query($con,$update)){
  329. echo "update";
  330. }
  331. else {
  332. echo "not";
  333. }
  334. }
  335.  
  336. ?>
  337. </form>
  338.  
  339.  
  340.  
  341.  
  342.  
  343. </div>
  344.  
  345.  
  346. </html>
  347.  
  348.  
  349. -------------------------------------------
  350. DELETE.PHP
  351.  
  352.  
  353. <!doctype html>
  354. <html>
  355. <head>
  356. <meta charset="utf-8">
  357. <title>Untitled Document</title>
  358. <link href="style.css" rel="stylesheet" type="text/css">
  359. </head>
  360. <body>
  361.  
  362. <?php
  363. include "config.php";
  364. ?>
  365. <br>
  366. <div id="TopPart">
  367.  
  368. <div id="LogoPart">
  369.  
  370. <img src="images/US_Cellular_logo_logotype.png" width="200px" alt="">
  371.  
  372. </div>
  373.  
  374. <div id="NavPart">
  375.  
  376. <menu>
  377. <li><a href="index.php">Home</a></li>
  378. <li><a href="insert.php">Insert</a></li>
  379. <li><a href="select.php">Select</a></li>
  380. <li><a href="update.php">Update</a></li>
  381. <li><a href="delete.php">Delete</a></li>
  382.  
  383. </menu>
  384.  
  385. </div>
  386. <div id="BannerPart">
  387.  
  388. <?php
  389. include "slider.html";
  390. ?>
  391.  
  392. </div>
  393. </div>
  394.  
  395. <div id="ContentPart">
  396.  
  397. <?php
  398.  
  399. include "config.php";
  400. $select = "SELECT * FROM lasttest_tbl";
  401. $result = mysqli_query($con,$select);
  402.  
  403. echo "<table border=1>";
  404. echo "<tr>";
  405. echo "<td> ID </td>";
  406. echo "<td> Name </td>";
  407. echo "<td> Date </td>";
  408. echo "<td> Info </td>";
  409. echo "</tr>";
  410.  
  411. while($row = mysqli_fetch_array($result)){
  412. echo "<tr>";
  413. echo "<td>" . $row['id'] . "</td>";
  414. echo "<td>" . $row['Name'] . "</td>";
  415. echo "<td>" . $row['Date'] . "</td>";
  416. echo "<td>" . $row['Info'] . "</td>";
  417. echo "</tr>";
  418.  
  419. }
  420.  
  421. echo "</table>";
  422.  
  423.  
  424. ?>
  425.  
  426. <br>
  427. <br>
  428.  
  429. <form method="post">
  430.  
  431. <input type="text" name="names">
  432.  
  433. <input type="submit" name="submit">
  434.  
  435. <?php
  436.  
  437. include "config.php";
  438.  
  439.  
  440. if(isset($_REQUEST['submit'])){
  441.  
  442. $deleteid = $_POST['names'];
  443.  
  444. $delete = "DELETE FROM lasttest_tbl WHERE Name ='".$deleteid."'";
  445.  
  446. if(mysqli_query($con,$delete)){
  447. echo"HIIIII";
  448. }
  449. else {
  450. echo "error"; }
  451. }
  452.  
  453.  
  454.  
  455.  
  456.  
  457.  
  458.  
  459. ?>
  460.  
  461.  
  462. </form>
  463.  
  464.  
  465.  
  466.  
  467.  
  468. </div>
  469.  
  470.  
  471. <div id="FooterPart">
  472.  
  473. <table border="0" styel="color: white;">
  474.  
  475. <tr>
  476.  
  477. <td>Adress <br> duhok</td>
  478. <td>Contact <br> 08365367</td>
  479. <td> <img src="images/US_Cellular_logo_logotype.png" width="100px; "alt=""></td>
  480.  
  481. </tr>
  482.  
  483. </table>
  484.  
  485. </div>
  486. </html>
  487.  
  488. ---------------------------------------------------------
  489.  
  490.  
  491. SELECT.PHP
  492.  
  493. <!doctype html>
  494. <html>
  495. <head>
  496. <meta charset="utf-8">
  497.  
  498. <title>Untitled
  499.  
  500.  
  501.  
  502. Document</title>
  503. <link href="style.css" rel="stylesheet" type="text/css">
  504. </head>
  505.  
  506. <div id="TopsPart">
  507.  
  508. <div id="LogoPart">
  509. <img src="images/US_Cellular_logo_logotype.png" width="200px" alt="">
  510.  
  511. </div>
  512. <div id="NavPart">
  513.  
  514. <menu>
  515. <li><a href="index.php">home</a></li>
  516. <li><a href="insert.php">insert</a></li>
  517. <li><a href="select.php">select</a></li>
  518.  
  519. <li><a href="update.php">update</a></li>
  520. <li><a href="delete.php">delete</a></li>
  521.  
  522.  
  523. </menu>
  524.  
  525.  
  526.  
  527. </div>
  528. <div id="BannerPart">
  529. Document</title>
  530. <link href="style.css" rel="stylesheet" type="text/css">
  531. </head>
  532.  
  533. <body><?php
  534.  
  535. include('slider.html');
  536.  
  537. ?>
  538.  
  539. </div>
  540.  
  541.  
  542. </div>
  543.  
  544. <div id="ContentPart">
  545.  
  546.  
  547.  
  548. <?php
  549.  
  550. include('config.php');
  551.  
  552. $select = "select * from lasttest_tbl";
  553. $result = mysqli_query($con,$select);
  554.  
  555. echo "<table border=1>";
  556. echo "<tr>";
  557. echo "<td> ID:</td>";
  558. echo "<td> Name:</td>";
  559. echo "<td> Date:</td>";
  560. echo "<td> Info:</td>";
  561. while($row= mysqli_fetch_array($result)){
  562. echo "<tr>";
  563. echo "<td>". $row['Id']."</td>";
  564. echo "<td>". $row['Name']."</td>";
  565. echo "<td>". $row['Date']."</td>";
  566. echo "<td>". $row['Info']."</td>";
  567. echo "</tr>";
  568. }
  569.  
  570. echo"</table>";
  571. ?>
  572.  
  573.  
  574.  
  575.  
  576.  
  577. </div>
  578.  
  579. <div id="FooterPart">
  580. <table width="100%" border="0" style="color:white; text-align:center;">
  581. <tbody>
  582. <tr>
  583. <td>Adress: <br> Duhok</td>
  584. <td>Phone: <br>123456789</td>
  585. <td><img src="images/DSC_0125.JPG" width="15px" </td>
  586. </tr>
  587. <tr>
  588. <td>&nbsp;</td>
  589. <td>Newros uni.</td>
  590. <td>&nbsp;</td>
  591. </tr>
  592. </tbody>
  593. </table>
  594.  
  595.  
  596. </div>
  597.  
  598.  
  599. </body>
  600. </html>
  601.  
  602. ------------------------------------------
  603. STYLE.CSS
  604.  
  605.  
  606. @charset "utf-8";
  607.  
  608.  
  609. #LogoPart img{
  610. margin:0 auto;
  611. display: block;
  612. }
  613.  
  614.  
  615. #NavPart menu {
  616. text-align: center;
  617. margin: 0 auto;
  618. padding: 12px 17px;
  619. list-style-type: none;
  620. }
  621.  
  622. #NavPart li{
  623. display: inline-block;
  624. color:white;
  625. }
  626.  
  627. #NavPart a{
  628. padding: 12px 17px;
  629. margin-left: 20px;
  630. text-decoration: none;
  631. color:white;
  632. }
  633. #NavPart a:hover{
  634. color:white;
  635. background-color: blue;
  636.  
  637. }
  638.  
  639. body{
  640. background-color: black;
  641. color:white;
  642. }
  643.  
  644.  
  645. #FooterPart{
  646. width:100%;
  647. text-align:center;
  648. color:white;
  649. bottom:0;
  650. position: absolute;
  651. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement