Advertisement
Guest User

Untitled

a guest
Jul 20th, 2017
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.82 KB | None | 0 0
  1. PHP TEIL
  2. ______________
  3.  
  4. Connection.php
  5.  
  6.  
  7.  
  8. <?php
  9.  
  10. class Db_connect {
  11.  
  12. public function connect() {
  13. $db = @new mysqli ('localhost', 'root', '', 'language_school_example');
  14. if (mysqli_connect_errno()) {
  15. die ('No connection could be made: '.mysqli_connect_error().'(mysqli_connect_errno().)');
  16. }
  17. include "querys.php";
  18. }
  19. }
  20. ?>
  21.  
  22. ____________________________________________________________________________________________________________________
  23.  
  24.  
  25. Querys.php
  26.  
  27.  
  28.  
  29. <?php
  30. class QryAction {
  31.  
  32. public function qry_ddm() {
  33. $db_var_one = 'SELECT ID,name
  34. FROM languages';
  35. $db_request_one = $db->query($db_var_one);
  36. if (!$db_request_one) {
  37. die ('Something is not right with your query: '.$db->error);
  38. }
  39.  
  40. }
  41. public function qry_ddm2() {
  42. $db_var_two = 'SELECT ID,name
  43. FROM languages';
  44. $db_request_two = $db->query($db_var_two);
  45. if (!$db_request_two) {
  46. die ('Something is not right with your query: '.$db->error);
  47. }
  48. }
  49. }
  50. ?>
  51.  
  52.  
  53. ________________________________________________________________________________________________________________________________
  54.  
  55. Dropdown.php
  56.  
  57.  
  58.  
  59. <?php
  60. include "Querys.php";
  61. class Dropdownmenu{
  62. public function fct_menu_one()
  63. {
  64. while ($row_one = $db_request_one->fetch_assoc()) {
  65. $post_one = $_POST['lng_one'];
  66. switch ($post_one){
  67. case "1":
  68. echo "Choice 1";
  69. case "2":
  70. echo "Choice 2";
  71. }
  72. }
  73. }
  74.  
  75. public function fct_menu_two()
  76. {
  77. while($row_two = $db_request_two->fetch_assoc()){
  78. $post_two = $_POST['lng_two'];
  79. switch ($post_two){
  80. case "1":
  81. echo "Choice 1";
  82. case "2":
  83. echo "Choice 2";
  84. }
  85. }
  86. }
  87. }
  88. ?>
  89.  
  90. ________________________________________________________________
  91.  
  92. HTML-TEIL
  93.  
  94.  
  95.  
  96. Index.php
  97.  
  98.  
  99.  
  100.  
  101. <?php
  102. include 'connection.php';
  103. include 'titel.php';
  104. include 'discription.php';
  105. include 'dropdown.php';
  106. include 'pic.php';
  107. ?>
  108. </head>
  109.  
  110. <body>
  111.  
  112. <form action="pic.php" method="post" id="dataupload" enctype="multipart/form-data">
  113.  
  114. <p>
  115.  
  116. <input type="text" name="titel_1" value="" />
  117. <input type="text" name="titel_2" value="" />
  118. <input type="hidden" name="MAX_FILE_SIZE" value="50000" />
  119. <input type="file" name="data" id="data" />
  120.  
  121.  
  122. <textarea name="textarea_1" id="txt_area1"></textarea>
  123. <textarea name="textarea_2" id="txt_area1"></textarea>
  124.  
  125.  
  126. <input type="submit" name="uploadbutton" id="uploadbutton" value="Upload" />
  127.  
  128. <select name="language_one" style="width:100px;size:5" id="slc_one">
  129. <option value="lng_one"> </option>
  130. </select>
  131.  
  132. <select name="language_two" style="width:100px;size:5" id="slc_two">
  133. <option value="lng_two"></option>
  134. </select>
  135.  
  136.  
  137. </p>
  138. </form>
  139. </body>
  140.  
  141. </html>
  142.  
  143. ________________________________________________________________________________________________________________
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement