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! Quote 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. Quote 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. Quote 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 Quote 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! Quote 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. Quote 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. Quote 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! Quote 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
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.