Home Ask Login Register

Developers Planet

Your answer is one click away!

Massimiliano Rubino February 2016

Pass user id in a mail form for registered user

I would like to pass the user id (that in a specific case is an email) in a email form. Here the php for registered user only:

'zubrag' => 'root',
'admin' => 'adminpass',
'phuket@iceagethai.com' => 'phuket'

Here what I use in the form:

  <input type="hidden" name="email" value="<?php global $id; ?>">

How should I write the form field? I Google around and in but I think I mix up some solution... Thank you


Benjamin February 2016

what is the importance of inserting the user id on input field? if you want to reuse the user id after the user is login to the system, assign the user id to on session variable and get user id from session variable.

Massimiliano Rubino February 2016

<input type="hidden" name="email" value="<?php echo $_SESSION['LOGIN']; ?>">

That works for me

Post Status

Asked in February 2016
Viewed 3,462 times
Voted 12
Answered 2 times


Leave an answer

Quote of the day: live life