Calling a user from DB, then posting it.

Discussion in 'PHP' started by wvccboy, Oct 7, 2007.

  1. #1
    Hey

    Can't seem to figure out how I'd do this.

    I have the MySQL database set up with userid and post. What I need to do is, the user logs in using php sessions(). I have that part down, but any way of revising that would be good.

    What the post page needs to do is call the MySQL db, and in the form, create a hidden field containing the userid, from which the user has logged in from. That's the part I can't figure out.

    Any advice would be good.

    Thanks!
     
    wvccboy, Oct 7, 2007 IP
  2. james_r

    james_r Peon

    Messages:
    194
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #2
    <input type="hidden" name="userid" value="<?=$_SESSION["userid"]?>" />

    That help?
     
    james_r, Oct 7, 2007 IP
  3. wvccboy

    wvccboy Notable Member

    Messages:
    2,632
    Likes Received:
    81
    Best Answers:
    1
    Trophy Points:
    250
    #3
    Sort of, but at the top, what kind of code should I be implementing?
     
    wvccboy, Oct 8, 2007 IP