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? Quote 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. Quote Link to comment https://forums.phpfreaks.com/topic/286072-newbie-with-a-question/#findComment-1468321 Share on other sites More sharing options...
Solution Pain Posted February 9, 2014 Solution Share Posted February 9, 2014 (edited) 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. Edited February 9, 2014 by Pain Quote 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 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!!! Quote Link to comment https://forums.phpfreaks.com/topic/286072-newbie-with-a-question/#findComment-1468324 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.