Hi Andy,
I would do something like this:
<?php if($listing['sale_or_rental_field'] == 'sales'): ?>
<a href="<?php echo $listing['_link'] ?>" class="button style1">Click Here</a>
<?php else: ?>
<a href="listingDetail_rentals.php?<?php echo urlencode($listing['address']).'-'.$listing['num']; ?>" class="button style1">Click Here</a>
<?php endif; ?>
This is just example code, so you might have to make a few changes to get it working. You'll need to change sale_or_rental_field to the field that stores if a property is rental or sales, and the value that would make it a sales type.
So if the record is a sales record, it will display the normal _link, but if it's a rental record type, then it will link to the listingDetail_rentals.php page with the num and first line of the address in the url.
Let me know if you have any questions.
Thanks!
Greg
Greg Thomas
PHP Programmer - interactivetools.com