Hi All
I have created a simple php rss feed with works fine.
However what I would really like is for the rss feed to dynamically change based on a search form. i.e. User searches for all properties for Rent, of Apartment type only, clicks on the rss icon which is then a link to his custom made feed which then only sends him those properties based on his search input.
Any help would be really appreciated as I've looked quite extensively through Google and can't really find anything on combining a feed with a users' search...at the momemt my search form is on a different page and the results show on the same pages as the property search.
The code as I have it is:
<?php header('Content-Type: text/xml'); ?>
<?php echo '<?xml version="1.0" encoding="utf-8"?>'; ?>
<rss version="2.0">
<channel>
<title>Dream Singapore Property - Newsfeed</title>
<link>
<p>http://www.xxxxxxxxxxxxxxxxxx.com</p>
<br />
<description>Properties for Sale & Rent in Singapore.</description>
<language>en-us</language>
<?php
// Connect to the database
require_once ('myaccess/dbc.php');
// Retrieve the property data from MySQL
$query = "SELECT prop_id, prop_cat, add_area, prop_bedroom, prop_bathroom, prop_type, prop_saletype, prop_price, DATE_FORMAT(add_date_orig,'%a, %d %b %Y %T') AS add_date_orig_rfc, " .
"add_road, prop_desc FROM property_details ORDER BY prop_type DESC";
$data = mysqli_query($dbc, $query);
// Loop through the array of property data, formatting it as RSS
while ($row = mysqli_fetch_array($data)) {
// Display each row as an RSS item
echo '<item>';
echo ' <title>' . 'Property ID:' . $row['prop_id'] . ' - ' . $row['prop_cat'] . ' - ' . 'Property Type:' . ' ' . $row['prop_type'] . ' / ' . $row['prop_saletype'] .'...</title>';
echo ' <link>http://www.xxxxxxxxxxxxxxxxxxxxxx.com/propertylisting_details.php?recordID=' . $row['prop_id'] . '</link>';
echo ' <pubDate>' . $row['add_date_orig_rfc'] . ' ' . date('T') . '</pubDate>';
echo ' <description><p class="maintextbold10">' . $row['prop_cat'] . ' - ' . $row['add_area'] . $row['prop_bedroom'] . 'Bedrooms' . ' ' . $row['prop_bathroom'] . 'Bathrooms' . '</p></description><br />';
echo ' <description><p class="maintextbold10">' . $row['prop_desc'] . '</p></description>';
echo '</item>';
}
?>
</channel>
</rss>