Using session variables on new forms (Full Version)

All Forums >> [Web Development] >> ASP and Database



Message


cahigg -> Using session variables on new forms (7/11/2001 13:01:00)

I'm using spooky login and would like to be able to capture the username on other forms to be written to a database. I'm setting up a comments form, survey, and forum that would save the username from the login to each submission. I would also like to setup a template in FrontPage 2000 for new forms. I tried using a hidden field as follows:
<input type=hidden name="username" value=<% Session("UserName")%>>
I don't get an error, but the username field remains blank.
I'm new to vbscript and frontpage so I'm hoping this can be done in frontpage so that my client can create new forms (along with the databases) as needed. Any help is greatly appreciated.

Thanks,
Chris





TimC -> RE: Using session variables on new forms (7/11/2001 22:57:00)

Try this

[Quotes around the value parameter]

<input type="hidden" name="userName"
value="<%=Session("Username")%>">


Oh -- ok, I new this one cause "Sir Spooky" answered the same question for me a couple months ago [grin]





Spooky -> RE: Using session variables on new forms (7/12/2001 20:18:00)

The "=" part is the important bit as it "writes" the value of the variable.\

<%=Session....

Or

<%Response.Write Session.....

------------------
§þððk¥
"I am Spooky of Borg. Prepare to be assimilated, babycakes!"
Subscribe to OutFront News
Database / DRW Q & A
The Spooky Login!
VP-ASP Shopping cart





cahigg -> RE: Using session variables on new forms (7/12/2001 20:25:00)

Mucho gracias! That did the trick. I had a feeling it would be syntax. Just want to add a big thumbs up for Spooky and his login script!

Thanks again,
Chris





Page: [1]

Valid CSS!




Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI
0.0625