Adding username (session varialbe) automatically to textarea

S

shikha

Hi,

I have a website, where users login using id and password which is stored in
session variables. They will put the comments in text area...which then gets
added in teh database....

I would like to add the username automatically in the text area....
so text area would look something like this: <username> commments
and if this text area gets updated by someone else...i would like the
username to be added again...and then second person's comment....

Any way how to do it...any help will be greatly appreciated!!!!

Thanks,

Shikha
 
D

David Berry

If you already have the username stored in a session variable then all you
would need to do is this:

<textarea rows="2" name="Comments"
cols="20"><%=Session("username")%></textarea>

Whenever the session changes (a new user logs in) the default text will
change.
 
S

shikha

Hi David,

What i want to capture is the name of person who originally entered the
comments, and if second person something else in addition to first person,
then have the second person name as well. You are right i do have that info
in session variables, but how would i add the username for second person or
more?

Thank you for your help :)

Shikha
 
D

David Berry

Each time a user adds a comment create a new record in the database. The
first record is the original user and all the others are additional
comments. This just like a discussion board / forum post. A person asks a
question, their user name and question are stored, then the next person adds
to the question / comment and their information is stored as the next
record. To see them all you just pull them out of the database and loop
through all the records for that question displaying them one after another.
 
S

shikha

Hi David,

Thank you once again for your reply. I never thought of implementing like a
forum post/discussion board. Thank you for your suggetion, i will definitely
explore that option and take it from there!

Once agtain thanks!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top