I’m making a form for my website, and when a Logged in user makes a post on the form, I want their Username to be posted in the database.
I tried this on the form’s end.
[code=php]<?php
<input name=”Name” type=”hidden” id=”Name”
value= $_SESSION[‘SESS_USERNAME’]
>
?>
I even tried this code on the file that the form triggers.
[code=php]$sql= “insert into Information (Name) values (‘$_SESSION[‘SESS_USERNAME’]’) “;
None of these worked. It would either give me errors or post blanks in the field.
I’m a PHP noob, so I’m not sure how a lot of PHP functions work. So I’m sure someone here can point me in the right direction.