kemper Posted June 14, 2007 Share Posted June 14, 2007 I have a form that I would like user_id attached to table so that the user may be able to edit their submission. I am not sure how or where to add it. Does it go into the form.php or the process.php? Please assist. Quote Link to comment https://forums.phpfreaks.com/topic/55501-posting-user_id-from-custom-form-submission/ Share on other sites More sharing options...
mr_zhang Posted June 14, 2007 Share Posted June 14, 2007 Not really sure I understand your problem. From what I get, you want to identify a user in the form.php so that you can determine which user is accessing the form.php. Is that correct? If so, you could just put in form.php $user_id=isset($_POST['userid'])?$_POST['userid']:''; if ($user_id!='') { echo '<form';//complete the form echo '<input type="hidden" name="userid" value="'.$user_id.'">'; echo '</form'; } else echo 'Please Login'; Quote Link to comment https://forums.phpfreaks.com/topic/55501-posting-user_id-from-custom-form-submission/#findComment-274343 Share on other sites More sharing options...
kemper Posted June 14, 2007 Author Share Posted June 14, 2007 that is correct. Where does this go? Quote Link to comment https://forums.phpfreaks.com/topic/55501-posting-user_id-from-custom-form-submission/#findComment-274354 Share on other sites More sharing options...
mr_zhang Posted June 14, 2007 Share Posted June 14, 2007 Where does this go? you mean where to put the code? In the form.php. You basically want php to create a dynamic hidden <input> tag. Put it between <form></form> How about you paste here the code of the form.php between the <form></form>. We can then "fix" the code for you easily. Quote Link to comment https://forums.phpfreaks.com/topic/55501-posting-user_id-from-custom-form-submission/#findComment-274409 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.