Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Square_meters<input type="text" name="Square_meters">
- Location<select name="Location">
- <option>All options</option>
- <option>Bucuresti</option>
- <option>Iasi</option>
- <option>Brasov</option>
- <option>Focsani</option>
- </select>
- Numb_rooms<select name="Numb_rooms">
- <option>All options</option>
- <option>Garsoniera</option>
- <option>2 Camere</option>
- <option>3 Camere</option>
- <option>4 Camere</option>
- <option>Vila</option>
- </select>
- <input type="submit" name="send" value="Search">
- </form>
- <?php
- header("content-type: image.jpg");
- if(isset($_POST['send']))
- {
- require_once("conexiune.php"); (this is my conect to sql database script)
- $id = $_POST['id'];
- $price = $_POST['price'];
- $price2 = $_POST['price2'];
- $square_m = $_POST['Square_meters'];
- $location = $_POST['location'];
- $numb_rooms = $_POST['Numb_rooms'];
- $selectie = mysql_query("SELECT * FROM apartamente WHERE id = '$id' && Pret>='$price'&& Pret<='$price2' && Location = '$location' && Square_meters='$Square_meters' && Numb_rooms = '$Numb_rooms ' ");
- while($row = mysql_fetch_array($selectie,MYSQL_ASSOC))
- {
- print"<tr><td>";
- print $row['id'];
- print"</td><td>";
- print $row['Pret'];
- print"</td><td>";
- print $row['Nr_camere'];
- print"</td><td>";
- print $row['Suprafata'];
- print"</td><td>";
- print $row['Locatie'];
- print"</td><td>";
- print $row['Descriere'];
- print"</td><td>";
- $selectie = mysql_query("SELECT * FROM apartamente WHERE id = '$id'
- && Pret>='$price'&& Pret<='$price2'" . ($location == "ALL OPTIONS" ? "" : "
- && Location = '$location'") . ($Square_meters == "ALL OPTIONS" ? "" : "
- && Square_meters='$Square_meters'") . ($Numb_rooms == "ALL OPTIONS" ? "" : "
- && Numb_rooms = '$Numb_rooms '"));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement