Wrox Programmer Forums
Go Back   Wrox Programmer Forums > PHP/MySQL > PHP Databases
PHP Databases Using PHP in conjunction with databases. PHP questions not specific to databases should be directed to one of the other PHP forums.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the PHP Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old May 11th, 2012, 04:50 AM
Authorized User
Join Date: Dec 2004
Posts: 30
Thanks: 0
Thanked 0 Times in 0 Posts
Default Generate link to webpage in PHP


I have a page which lists a table of products, generated from a MySQL Query.

I want the user to click on a line (product) and to be directed to the next page (built in PHP) which shows that product, based on the field "product_id" (which uniquely identifies the product).

The "next page's" name is /source/product_show.php.

I know I have to programatically generate a

<a href="..." />
in the product list table - which sends the product_id bit to the next page (product_show.php) - BUT I DON'T EXACTLY HOW.
I mean, what exactly should there be in the <a href=... > tag ?

Thanks in advance,

Old May 14th, 2012, 05:47 AM
Authorized User
Join Date: Dec 2004
Posts: 30
Thanks: 0
Thanked 0 Times in 0 Posts

Well, since nobody seems to know, I WILL TELL YOU :

<a href="</source/product_show.php?product_id=<product_id>"> Link Name </a>
where <product_id> is the actual product_id value that the query returned, different for every line of the query result.
Of course, the "<a href..." gets built dynamically.



Similar Threads
Thread Thread Starter Forum Replies Last Post
coding php which link that i want to view a form syazlan Pro PHP 0 January 30th, 2007 03:38 AM
pls help how can I use php to adjust my webpage [email protected] Beginning PHP 0 August 10th, 2006 02:35 PM
how to generate random non repeated numbers in php method PHP How-To 0 February 6th, 2006 02:36 PM
Establish Com link to Webpage Mantis Pro VB 6 3 April 18th, 2005 04:14 AM
Link tracking with PHP sami PHP How-To 11 November 14th, 2003 12:31 AM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.