Advertisement
Guest User

Untitled

a guest
Feb 23rd, 2019
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.81 KB | None | 0 0
  1. Square_meters<input type="text" name="Square_meters">
  2.  
  3. Location<select name="Location">
  4. <option>All options</option>
  5. <option>Bucuresti</option>
  6. <option>Iasi</option>
  7. <option>Brasov</option>
  8. <option>Focsani</option>
  9. </select>
  10. Numb_rooms<select name="Numb_rooms">
  11. <option>All options</option>
  12. <option>Garsoniera</option>
  13. <option>2 Camere</option>
  14. <option>3 Camere</option>
  15. <option>4 Camere</option>
  16. <option>Vila</option>
  17. </select>
  18. <input type="submit" name="send" value="Search">
  19. </form>
  20. <?php
  21. header("content-type: image.jpg");
  22.  
  23.  
  24.  
  25. if(isset($_POST['send']))
  26. {
  27. require_once("conexiune.php"); (this is my conect to sql database script)
  28. $id = $_POST['id'];
  29. $price = $_POST['price'];
  30. $price2 = $_POST['price2'];
  31. $square_m = $_POST['Square_meters'];
  32. $location = $_POST['location'];
  33. $numb_rooms = $_POST['Numb_rooms'];
  34. $selectie = mysql_query("SELECT * FROM apartamente WHERE id = '$id' && Pret>='$price'&& Pret<='$price2' && Location = '$location' && Square_meters='$Square_meters' && Numb_rooms = '$Numb_rooms ' ");
  35.  
  36.  
  37. while($row = mysql_fetch_array($selectie,MYSQL_ASSOC))
  38. {
  39.  
  40. print"<tr><td>";
  41. print $row['id'];
  42. print"</td><td>";
  43. print $row['Pret'];
  44. print"</td><td>";
  45. print $row['Nr_camere'];
  46. print"</td><td>";
  47. print $row['Suprafata'];
  48. print"</td><td>";
  49. print $row['Locatie'];
  50. print"</td><td>";
  51. print $row['Descriere'];
  52. print"</td><td>";
  53.  
  54. $selectie = mysql_query("SELECT * FROM apartamente WHERE id = '$id'
  55. && Pret>='$price'&& Pret<='$price2'" . ($location == "ALL OPTIONS" ? "" : "
  56. && Location = '$location'") . ($Square_meters == "ALL OPTIONS" ? "" : "
  57. && Square_meters='$Square_meters'") . ($Numb_rooms == "ALL OPTIONS" ? "" : "
  58. && Numb_rooms = '$Numb_rooms '"));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement