Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

PHP details page?

New Here ,
Jan 14, 2008 Jan 14, 2008
Hi,

I need an answer to something i should know and have probably already learned,
but i think the problem is that i'm not really grasping the PHP terminology and syntax properly yet. I have scoured the net (and probably found what i needed to and didn't even know it) and i'm still stuck.
What i have so far is a homepage with navigation and what i want to do is setup all the links to link to one showDetail page. I want to show different details on that page according to what link was clicked, and i'm not sure how to do that?
To clarify, some of the links i have are 'venues' (which is split into venues in different towns) and 'photographers'.
If the user clicks the venues' link they will be taken to the showDetail page and see all venues for all towns, but shoul they click the 'east london' link under venues they will see only venues in East London. If they click 'photographers' they will see all photographers on the showDetail page.
Do i need only one recordset (that gets everything) on the showDetail page or do i need one for 'getVenuesAll', 'getVenuesEL', 'getPhotographers' etc.? Either way, how do i limit the results according to which link brought the user to the showDetail page? I'm pretty confident setting up the recordsets, just not sure how to make sure the showDetail page limits the results to only one recordset of many or how to limit the results of one big recordset if it's not limited by the MySQL statement.
I realise i could have a different page for each link, each with their own recordset, but that would surely defeat the point of a dynamic site. I would really appreciate any clarity or guidance here, or a link to some help.
I am using DW8 on a windows XP machine.

Thanks so much!
Shane
TOPICS
Server side applications
263
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jan 15, 2008 Jan 15, 2008
LATEST
farsightedmedia wrote:
> What i have so far is a homepage with navigation and what i want to do is
> setup all the links to link to one showDetail page. I want to show different
> details on that page according to what link was clicked, and i'm not sure how
> to do that?

You add a query string to the link containing the criteria you want the
showDetail page to use. For example:

showDetail.php?type=venues&location=East_London

The values will be retrieved in showDetail.php through the $_GET array
as $_GET['type'] and $_GET['location']. Use these values as variables in
the SQL query that creates the recordset.

How many recordsets you need depends on the table structure of your
database. For example, if venues and photographers are in different
tables, you would need a structure like this:

if (isset($_GET['type']) && $_GET['type'] == 'venues') {
// create venues recordset
} elseif (isset($_GET['type']) && $_GET['type'] == 'photographers') {
// create photographers recordset
}

--
David Powers, Adobe Community Expert
Author, "The Essential Guide to Dreamweaver CS3" (friends of ED)
Author, "PHP Solutions" (friends of ED)
http://foundationphp.com/
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines