surreylee Posted February 9, 2014 Share Posted February 9, 2014 Hi guys. I am a newbie to working with PHP and I am trying to figure out its capability when developing websites. But, is it possible to accept a user's input and use their response to send them to a specific URL? Or is it possible to use their input and allow them to download a specific file or view at a specific file/document? Link to comment https://forums.phpfreaks.com/topic/286072-newbie-with-a-question/ Share on other sites More sharing options...
.josh Posted February 9, 2014 Share Posted February 9, 2014 yes. Link to comment https://forums.phpfreaks.com/topic/286072-newbie-with-a-question/#findComment-1468321 Share on other sites More sharing options...
Pain Posted February 9, 2014 Share Posted February 9, 2014 Hi. Well since you are a beginner I recommend doing this. Retrieve info from the database. Lets say 'id'. Then your first line of the form should be something like this: <form name="form1" action="profile.php?id=<?php echo $id; ?>" method="POST" /> Then in your profile.php get that id from the URL by doing this: $id = $_GET['id']; Now you can use 'id' in WHERE clause and retrieve info from the database (that belongs to this id). Note: this is a bad practice, you should not use this in the future, however this might help you understand a bit more PHP. Link to comment https://forums.phpfreaks.com/topic/286072-newbie-with-a-question/#findComment-1468322 Share on other sites More sharing options...
surreylee Posted February 9, 2014 Author Share Posted February 9, 2014 On 2/9/2014 at 9:27 PM, Pain said: Hi. Well since you are a beginner I recommend doing this. Retrieve info from the database. Lets say 'id'. Then your first line of the form should be something like this: <form name="form1" action="profile.php?id=<?php echo $id; ?>" method="POST" /> Then in your profile.php get that id from the URL by doing this: $id = $_GET['id']; Now you can use 'id' in WHERE clause and retrieve info from the database (that belongs to this id). Note: this is a bad practice, you should not use this in the future, however this might help you understand a bit more PHP. Thanks Pain, that defintely gives me a better idea and understanding of what I can do. Thanks!!! Link to comment https://forums.phpfreaks.com/topic/286072-newbie-with-a-question/#findComment-1468324 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.