Page 1 of 1

How to display sub-detail page from tabular page

Posted: Sun Feb 05, 2012 8:57 pm
by lakc
Hi,

I know how to display the multiple records in a table with a few selected columns.

But there are more details that I cant display in the same tabular page.

Therefore, when i click on any of the first values of a index col of any record, i should be displaying a full detailed page of that record.

So please verify with me. I would need to store the id of the record i click (each index value in the col for every record will be hyperlinked), which in turn is stored in hidden value.

Then i query the db to return the full complete record matching that id. Now heres the problem how can i make it display the results in a new frame or new window at the instance event of click????

Many thanks,
Lak.

Re: Hw to display sub-detail page from tabular page

Posted: Sun Feb 05, 2012 11:59 pm
by jacek
In your first table you can link to another page like view_item.php?id=<the_id> then on the second list you can link to view_details.php?item_id=$_GET['id']&id=<the_id>

Essentially this will keep the id in the URL.

Re: Hw to display sub-detail page from tabular page

Posted: Thu Feb 23, 2012 12:09 pm
by lakc
hey jacek can u explain this more further in detail coding...

simple codings for both

Re: How to display sub-detail page from tabular page

Posted: Thu Feb 23, 2012 11:15 pm
by jacek
Well say you have you first page that shows the list of all records, the id of each one could be linked to a new page like this
<a href="view_record.php?id=<?php echo $record['id']; ?>">Some Text</a>
Then when clicked it will take the user to the page view_record.php?id=7 where 7 would be replaced with that records ID.

You can get the id in the new page by using $_GET['id'] and use that to decide which row from the database to take the information form.

Re: How to display sub-detail page from tabular page

Posted: Sun Feb 26, 2012 7:04 am
by lakc
Can I do it without the url param passing... like a function call to class...it would need the "require" statement...

So the <a href> perhaps would hv the call statement.... is this possible...???

By the way guys i want to verify

<?php Class className functionName(){ } ?> ok..so save this using className as fileName.php.... is it the same as className.java

Re: How to display sub-detail page from tabular page

Posted: Mon Feb 27, 2012 11:59 am
by jacek
lakc wrote:Can I do it without the url param passing... like a function call to class...it would need the "require" statement...

So the <a href> perhaps would hv the call statement.... is this possible...???
Not really no, Think of it in terms of page requests. Once your browser is done loading the first page it closes the connection completely and reopens a new one when you click the link. There is no way for it to send information to the server other than through the URL requested.
lakc wrote:<?php Class className functionName(){ } ?> ok..so save this using className as fileName.php.... is it the same as className.java
You can save it as whatever you like really. The accepted standard seems to be the same as Java so className would be in ClassName.php. I tend to ignore this and save class_name in class_name.inc.php just because that's what I'm used to.