Answered
redirect from results page PHP
Hi There
I have a Real Estate search page with two drop down menus, Bedrooms and Bathrooms that allows a user to search for houses by selecting the number of bedrooms and or bathrooms they would like. the numbers chosen by the user are passed to results.php using the POST method and all property meeting the search is shown.
On the page results.php the numbers chosen by the users are put into two variables "beds" and "baths"
Here is the SQL from the recordset
SELECT bedrooms, bathrooms, smallPhoto, `desc`,address
FROM property
WHERE bedrooms LIKE beds AND bathrooms LIKE baths
ORDER BY bedrooms DESC
for example the search is made for 1 bedroom 1 bathroom. Several properties that fit the criteria are shown.
Where property meets the search criteria all is well, however when someone searches for a 1 bedroom 3 bathroom property and none are found in the database the results page is still shown but with all the fields blank.
What I would like to do is display another page other than the results page saying something along the lines of "Sorry there are no matching properties", how do I do this?
Thanks
I have a Real Estate search page with two drop down menus, Bedrooms and Bathrooms that allows a user to search for houses by selecting the number of bedrooms and or bathrooms they would like. the numbers chosen by the user are passed to results.php using the POST method and all property meeting the search is shown.
On the page results.php the numbers chosen by the users are put into two variables "beds" and "baths"
Here is the SQL from the recordset
SELECT bedrooms, bathrooms, smallPhoto, `desc`,address
FROM property
WHERE bedrooms LIKE beds AND bathrooms LIKE baths
ORDER BY bedrooms DESC
for example the search is made for 1 bedroom 1 bathroom. Several properties that fit the criteria are shown.
Where property meets the search criteria all is well, however when someone searches for a 1 bedroom 3 bathroom property and none are found in the database the results page is still shown but with all the fields blank.
What I would like to do is display another page other than the results page saying something along the lines of "Sorry there are no matching properties", how do I do this?
Thanks
