Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

SQL fill a form?

  • 05-04-2009 7:26pm
    #1
    Registered Users, Registered Users 2 Posts: 8,004 ✭✭✭


    Hi Folks,

    I'm currently developing for a friend. We need a form to fill automatically when a user logs in. For instances Mr.X log's in, and when he goes to the "Contact Us" form, his email that he signed up is already in the form. Its part of a verification process so that a user is tied to certain details.

    Many Thanks!

    ironclaw


Comments

  • Registered Users, Registered Users 2 Posts: 9,579 ✭✭✭Webmonkey


    Why don't you just set the initial/default value of the HTML tag. Do a simple DB look up and get the current user's email and set it. Or am I reading this wrong?


  • Registered Users, Registered Users 2 Posts: 8,004 ✭✭✭ironclaw


    Yeah, exactly. Was doing the calls wrong. I'll keep tinkering. Thanks for the help.


  • Registered Users, Registered Users 2 Posts: 2,591 ✭✭✭tommycahir


    If you are developing in PHP then you could use sessions, when the member log's in the email variable in the session is set. Then retrieve the value and use it when they go to the page with the form on it

    setting the session would be something like this code:
    //Login Successful
    session_regenerate_id();
    $member = mysql_fetch_assoc($result);
    $_SESSION['SESS_MEMBER_ID'] = $member['member_id'];
    $_SESSION['SESS_FIRST_NAME'] = $member['firstname'];
    $_SESSION['SESS_EMAIL'] = $member['email'];
    session_write_close();
    


Advertisement