liam Posted August 24, 2008 Share Posted August 24, 2008 hi I am new to php / mysql and Im learning as I go. I have ran into a problem. I have a login script that creates a session when logged in. I can use the members name on the page by typing <?php echo "Hello there, {$_SESSION['name']}! Welcome to my site!"; ?> What Id like is once a user logs in they use a form to submit data to the database. But id also like their name from the session to be stored with any entries, but without them being able to manipulate it. I found this $result = mysql_query("INSERT INTO TABLE SET id='".$_SESSION['name']."'") or die('Could not commit insert.'); and this puts the session name into the database but i cannot get it to work in conjunction with a regular form that I made using a tutorial found here: http://www.spoono.com/php/tutorials/upload/add.txt Can somebody please point out what id need to do? Any more questions please ask Thanks for your time Liam Quote Link to comment Share on other sites More sharing options...
zq29 Posted August 26, 2008 Share Posted August 26, 2008 If you post up your code so far, we might be able to help you out a little easier. As a side note, it would make a lot more sense to store the users id rather than their name - A users name is generally not considered unique! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.