Session variable from FP form (sorry for duplicate)

S

Stephen Green

I currently have a page on which I have a FP form that submits to a
database - it works. What I'd like to do is capture some of that form data
into session variables for use on other pages.

I tried placing code like this - <% session("variablename") =
request.form("fieldname")%> - just before the </form> tag. Nothing. I tired
right after the </form> tag. Nothing.

Is what I'm trying to do possible? Is my notion of the code wrong?

Thanks and Happy New Year.

Stephen
 
M

Mark Fitzpatrick

Stephen,
You may need to check to see if the form field information is null
first. Otherwise, this will be executed every single time and constantly
setting the session variable to nothing if the form has not been entered.
Try

<%
IF !((IsNull(request.form("fieldname"))) OR
(IsEmpty(request.form("fieldname")))) THEN
( session("variablename") = request.form("fieldname")
End if
%>

You'll have to pardon my sloppy VBScript, I've been using C# too much
lately.

Hope this helps,
Mark Fitzpatrick
Microsoft MVP - FrontPage
 
S

Stephen Green

Thanks, Mark!

I'll try that code. The real question seems to be where to put it - on the
same page as the form? if so, where on the page? on the confirmation page?

Thanks again and Happy New Year!

Stephen
 
J

Jens Peter Karlsen[FP MVP]

Same page as the Form.

Regards Jens Peter Karlsen. Microsoft MVP - Frontpage.
-----Original Message-----
From: Stephen Green [mailto:[email protected]]
Posted At: 1. januar 2005 17:37
Posted To: microsoft.public.frontpage.client
Conversation: Session variable from FP form (sorry for duplicate)
Subject: Re: Session variable from FP form (sorry for duplicate)


Thanks, Mark!

I'll try that code. The real question seems to be where to
put it - on the same page as the form? if so, where on the
page? on the confirmation page?

Thanks again and Happy New Year!

Stephen

Mark Fitzpatrick said:
Stephen,
You may need to check to see if the form field information is
null first. Otherwise, this will be executed every single time and
constantly setting the session variable to nothing if the form has not been entered.
Try

<%
IF !((IsNull(request.form("fieldname"))) OR
(IsEmpty(request.form("fieldname")))) THEN
( session("variablename") = request.form("fieldname")
End if
%>

You'll have to pardon my sloppy VBScript, I've been using C# too
much lately.

Hope this helps,
Mark Fitzpatrick
Microsoft MVP - FrontPage
of that form
data
 

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