Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > PHP/MySQL > PHP Databases
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old May 11th, 2012, 04:50 AM
Authorized User
Points: 173, Level: 3
Points: 173, Level: 3 Points: 173, Level: 3 Points: 173, Level: 3
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Dec 2004
Location: , , .
Posts: 30
Thanks: 0
Thanked 0 Times in 0 Posts
Default Generate link to webpage in PHP

Hi,

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

Code:
<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,

Mike
Reply With Quote
  #2 (permalink)  
Old May 14th, 2012, 05:47 AM
Authorized User
Points: 173, Level: 3
Points: 173, Level: 3 Points: 173, Level: 3 Points: 173, Level: 3
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Dec 2004
Location: , , .
Posts: 30
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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

Code:
<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.

Cheers,

Mike
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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 445@gmx.de 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



All times are GMT -4. The time now is 12:37 PM.


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