Jump to content

posting user_id from custom form submission?


kemper

Recommended Posts

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.

 

Link to comment
Share on other sites

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';

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.