|
|
|
| ||||||||||||||||||||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
view page detail
i have rows of products in a table, what i want to do when i click on the any of the product it will bring me to product detail how to do that
|
|
#2
|
|||
|
|||
|
RE: view page detail
The easiest way to do it is to just pass the id (some type of identifier) of the proguct via the url. check out the tutorials page on this web site for an example. http://codewalkers.com/tutorials.php ...if you click on any one of the tutorial links, it passes the id of the tutorial in the url. then on the page you pass that id to, you can do a lookup in your database for the information you want to display..
|
|
#3
|
|||
|
|||
|
RE: view page detail
sorry i'm a php newbie can so write/show me the code how to pass the id and how to retrieve it back
|
|
#4
|
|||
|
|||
|
RE: view page detail
Well, you'd want to construct a URL on the first page, the one with your products in a table. So, you'd do something like this:
<a href="productdetail.php?id=4">Click here for product detail</a> Then on the page productdetail.php you could do something like this: $query="SELECT * FROM products WHERE id=$id"; then run the query and pull back the info and use it.... |
![]() |
| Viewing: Codewalkers Forums > PHP Related > PHP Coding > view page detail |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|