Page 1 of 1
How can a user click a search result for more details?
Posted: Mon May 17, 2010 7:41 am
by tom8521
I have a property style website where users can find properties against certain criteria.
The relevant results are shown in row format, but how can they then click a specific property result to view full details? - How is this done?
Thanks!
Re: How can a user click a search result for more details?
Posted: Mon May 17, 2010 10:14 am
by social_experiment
Create a link to a page that uses some value from the row in the query string. For example :
Code: Select all
<?php echo '<a href="page.name?id=value_from_row">Click here for more details</a>'; ?>
In your browser it will be link and once the user / visitor clicks on the link, they will be taken to the page where the value of 'id' (or whichever value you implement) will dictate the information shown.
Re: How can a user click a search result for more details?
Posted: Mon May 17, 2010 1:04 pm
by tom8521
But if I create an address that moves the user to a page containing a property id, how do i then tell that new page to read the id within the address bar?
Re: How can a user click a search result for more details?
Posted: Mon May 17, 2010 1:39 pm
by flying_circus
There are several ways to do, the easiest would be to pass a variable in the querystring something like:
http://www.example.org/property.php?property_id=123
You would then use PHP to check if the $_GET variable "property_id" is set, and if it is, pull the properties information from the database.
Code: Select all
if(isset($_GET['property_id'])) {
# Validate $_GET['property_id'], then check database for property existence and details
}