Is there anyway to carry a value in php forward to a second page?
Posted
by
Henry Aspden
on Stack Overflow
See other posts from Stack Overflow
or by Henry Aspden
Published on 2012-11-15T22:56:48Z
Indexed on
2012/11/15
23:00 UTC
Read the original article
Hit count: 312
I have created a php site, and previously it was listing only products with defined values. I have now changed it to include an array of products for example all products WHERE id = "spotlights"
and this works great so it means I can add new products just to the database, but I still have to add the second page manually. e.g going from the product div on the main page, through to www.example.com/spotlight_1.php
Is there anyway in PHP to carry the data from my index.php e.g. the ID through to the next page? so that I can have a template product.php page, and I can use a database pull to echo the product information required.
So on index.php i click on the product with ID="1" and on the product.php page, it loads the relevant data for product 1.
I can write the php SQL/mySQL calls myself, its just the way to carry accross a value from the previous page which I dont understand
Regards
Henry
p.s. all the IDs and things are stored in the database already as 1 to 3digit values e.g. 3 or or 93 or 254
Any advice as always is greatly appreciated
Regards
Henry
© Stack Overflow or respective owner