budimir Posted July 5, 2008 Share Posted July 5, 2008 How to pass an ID to next page??? Which is the most safest way that the ID will be passed on to another page? Please, help! Link to comment https://forums.phpfreaks.com/topic/113371-solved-passing-id-to-next-page/ Share on other sites More sharing options...
DarkWater Posted July 5, 2008 Share Posted July 5, 2008 1) Which ID? A user id...? 2) Sessions are most likely the answer to your question. Link to comment https://forums.phpfreaks.com/topic/113371-solved-passing-id-to-next-page/#findComment-582448 Share on other sites More sharing options...
budimir Posted July 5, 2008 Author Share Posted July 5, 2008 Sorry, not user ID. Let's say Item ID. For instance I have a product and when I click on it I want to see the details about it. But I can't pass an ID for that product. Link to comment https://forums.phpfreaks.com/topic/113371-solved-passing-id-to-next-page/#findComment-582452 Share on other sites More sharing options...
DarkWater Posted July 5, 2008 Share Posted July 5, 2008 Oh. Pass it in the URL and then it'll be in $_GET[]. Ex: http://www.mysite.com/products.php?id=4 Link to comment https://forums.phpfreaks.com/topic/113371-solved-passing-id-to-next-page/#findComment-582453 Share on other sites More sharing options...
themistral Posted July 5, 2008 Share Posted July 5, 2008 Or you can use $_POST - if you are using a form and can populate a field with the item id. Read up on forms and using $_GET and $_POST - it is an important thing to learn! Link to comment https://forums.phpfreaks.com/topic/113371-solved-passing-id-to-next-page/#findComment-582458 Share on other sites More sharing options...
budimir Posted July 5, 2008 Author Share Posted July 5, 2008 How to pass it through the URL? That's the part I don't understand. Link to comment https://forums.phpfreaks.com/topic/113371-solved-passing-id-to-next-page/#findComment-582462 Share on other sites More sharing options...
DarkWater Posted July 5, 2008 Share Posted July 5, 2008 Just append it to the URL when you echo the products out. Link to comment https://forums.phpfreaks.com/topic/113371-solved-passing-id-to-next-page/#findComment-582463 Share on other sites More sharing options...
budimir Posted July 5, 2008 Author Share Posted July 5, 2008 Thanks! Link to comment https://forums.phpfreaks.com/topic/113371-solved-passing-id-to-next-page/#findComment-582464 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.