PC Review


Reply
Thread Tools Rate Thread

asp increment help

 
 
Paul C
Guest
Posts: n/a
 
      1st Oct 2007
Hi I am trying to have a submit once to a form using asp . The idea I have
is to incriment a dim by 1 everytime the script runs and then set up
something like


Dim xonce
if
xonce = "2" then Response .write "the form has already been submitted"
else

how would I first set up the dim to increment and then response write when
it has

Thanks
Paul M


 
Reply With Quote
 
 
 
 
Paul C
Guest
Posts: n/a
 
      1st Oct 2007
Thinking on it should be something like

Dim xonce
if
xonce is more than "1" then Response .write "the form has already been
submitted"
else

paul M

"Paul C" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi I am trying to have a submit once to a form using asp . The idea I have
> is to incriment a dim by 1 everytime the script runs and then set up
> something like
>
>
> Dim xonce
> if
> xonce = "2" then Response .write "the form has already been submitted"
> else
>
> how would I first set up the dim to increment and then response write
> when it has
>
> Thanks
> Paul M
>



 
Reply With Quote
 
Paul C
Guest
Posts: n/a
 
      1st Oct 2007
Just, thought it won't work will it? when the page refreshes the dim xonce
won't hold its value so it won't increment
how is submit once usually done?
Thanks
Paul M

"Paul C" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Thinking on it should be something like
>
> Dim xonce
> if
> xonce is more than "1" then Response .write "the form has already been
> submitted"
> else
>
> paul M
>
> "Paul C" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>> Hi I am trying to have a submit once to a form using asp . The idea I
>> have is to incriment a dim by 1 everytime the script runs and then set up
>> something like
>>
>>
>> Dim xonce
>> if
>> xonce = "2" then Response .write "the form has already been submitted"
>> else
>>
>> how would I first set up the dim to increment and then response write
>> when it has
>>
>> Thanks
>> Paul M
>>

>
>



 
Reply With Quote
 
Bob Lehmann
Guest
Posts: n/a
 
      1st Oct 2007
>> how is submit once usually done?
By making xonce a session varible.

dim xonce
xonce = session("xonce")
if xonce = 0 then session("xonce") = xonce + 1
response.write "OK to process"
' you wouldn't actually do the response write
' you would handle the form
else
response.write "You already submitted this form"
' you wouldn't necessarily do the response write
end if

If you wanted to persist for a period of time longer than the session you
would have to use a cookie, or have some type of log in functionality.

Bob Lehmann

"Paul C" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Just, thought it won't work will it? when the page refreshes the dim xonce
> won't hold its value so it won't increment
> how is submit once usually done?
> Thanks
> Paul M
>
> "Paul C" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > Thinking on it should be something like
> >
> > Dim xonce
> > if
> > xonce is more than "1" then Response .write "the form has already been
> > submitted"
> > else
> >
> > paul M
> >
> > "Paul C" <(E-Mail Removed)> wrote in message
> > news:(E-Mail Removed)...
> >> Hi I am trying to have a submit once to a form using asp . The idea I
> >> have is to incriment a dim by 1 everytime the script runs and then set

up
> >> something like
> >>
> >>
> >> Dim xonce
> >> if
> >> xonce = "2" then Response .write "the form has already been submitted"
> >> else
> >>
> >> how would I first set up the dim to increment and then response write
> >> when it has
> >>
> >> Thanks
> >> Paul M
> >>

> >
> >

>
>



 
Reply With Quote
 
Mark Fitzpatrick
Guest
Posts: n/a
 
      1st Oct 2007
If you want to store it in memory you have two choices, as an Application
variable so that it is incremented no matter who the user is, or a Session
variable if you only want to keep track of it based upon the current user.

Ideally though, you want this in a database if you really want a permanent
record, otherwise the data will be lost once the application is unloaded
from the server's memory which happens when the last session expires.


--
Hope this helps,
Mark Fitzpatrick
Microsoft MVP - FrontPage

"Paul C" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Just, thought it won't work will it? when the page refreshes the dim xonce
> won't hold its value so it won't increment
> how is submit once usually done?
> Thanks
> Paul M
>
> "Paul C" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>> Thinking on it should be something like
>>
>> Dim xonce
>> if
>> xonce is more than "1" then Response .write "the form has already been
>> submitted"
>> else
>>
>> paul M
>>
>> "Paul C" <(E-Mail Removed)> wrote in message
>> news:(E-Mail Removed)...
>>> Hi I am trying to have a submit once to a form using asp . The idea I
>>> have is to incriment a dim by 1 everytime the script runs and then set
>>> up something like
>>>
>>>
>>> Dim xonce
>>> if
>>> xonce = "2" then Response .write "the form has already been submitted"
>>> else
>>>
>>> how would I first set up the dim to increment and then response write
>>> when it has
>>>
>>> Thanks
>>> Paul M
>>>

>>
>>

>
>



 
Reply With Quote
 
Paul C
Guest
Posts: n/a
 
      2nd Oct 2007
Thanks Bob
Paul M

"Bob Lehmann" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>>> how is submit once usually done?

> By making xonce a session varible.
>
> dim xonce
> xonce = session("xonce")
> if xonce = 0 then session("xonce") = xonce + 1
> response.write "OK to process"
> ' you wouldn't actually do the response write
> ' you would handle the form
> else
> response.write "You already submitted this form"
> ' you wouldn't necessarily do the response write
> end if
>
> If you wanted to persist for a period of time longer than the session you
> would have to use a cookie, or have some type of log in functionality.
>
> Bob Lehmann
>
> "Paul C" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>> Just, thought it won't work will it? when the page refreshes the dim
>> xonce
>> won't hold its value so it won't increment
>> how is submit once usually done?
>> Thanks
>> Paul M
>>
>> "Paul C" <(E-Mail Removed)> wrote in message
>> news:(E-Mail Removed)...
>> > Thinking on it should be something like
>> >
>> > Dim xonce
>> > if
>> > xonce is more than "1" then Response .write "the form has already been
>> > submitted"
>> > else
>> >
>> > paul M
>> >
>> > "Paul C" <(E-Mail Removed)> wrote in message
>> > news:(E-Mail Removed)...
>> >> Hi I am trying to have a submit once to a form using asp . The idea I
>> >> have is to incriment a dim by 1 everytime the script runs and then set

> up
>> >> something like
>> >>
>> >>
>> >> Dim xonce
>> >> if
>> >> xonce = "2" then Response .write "the form has already been submitted"
>> >> else
>> >>
>> >> how would I first set up the dim to increment and then response write
>> >> when it has
>> >>
>> >> Thanks
>> >> Paul M
>> >>
>> >
>> >

>>
>>

>
>



 
Reply With Quote
 
Paul C
Guest
Posts: n/a
 
      2nd Oct 2007
Thanks Mark
Paul M

"Mark Fitzpatrick" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> If you want to store it in memory you have two choices, as an Application
> variable so that it is incremented no matter who the user is, or a Session
> variable if you only want to keep track of it based upon the current user.
>
> Ideally though, you want this in a database if you really want a permanent
> record, otherwise the data will be lost once the application is unloaded
> from the server's memory which happens when the last session expires.
>
>
> --
> Hope this helps,
> Mark Fitzpatrick
> Microsoft MVP - FrontPage
>
> "Paul C" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>> Just, thought it won't work will it? when the page refreshes the dim
>> xonce won't hold its value so it won't increment
>> how is submit once usually done?
>> Thanks
>> Paul M
>>
>> "Paul C" <(E-Mail Removed)> wrote in message
>> news:(E-Mail Removed)...
>>> Thinking on it should be something like
>>>
>>> Dim xonce
>>> if
>>> xonce is more than "1" then Response .write "the form has already been
>>> submitted"
>>> else
>>>
>>> paul M
>>>
>>> "Paul C" <(E-Mail Removed)> wrote in message
>>> news:(E-Mail Removed)...
>>>> Hi I am trying to have a submit once to a form using asp . The idea I
>>>> have is to incriment a dim by 1 everytime the script runs and then set
>>>> up something like
>>>>
>>>>
>>>> Dim xonce
>>>> if
>>>> xonce = "2" then Response .write "the form has already been submitted"
>>>> else
>>>>
>>>> how would I first set up the dim to increment and then response write
>>>> when it has
>>>>
>>>> Thanks
>>>> Paul M
>>>>
>>>
>>>

>>
>>

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Row Increment C Microsoft Excel Programming 1 8th Apr 2009 04:41 PM
Post-Increment and Pre-Increment Overloading jehugaleahsa@gmail.com Microsoft C# .NET 13 20th Nov 2007 10:34 AM
increment per9000 Microsoft C# .NET 1 3rd Apr 2007 08:10 AM
increment by 1 =?Utf-8?B?bWFydHlu?= Microsoft Access Database Table Design 3 16th May 2006 05:34 PM
Increment/Increment letter in alphabetical order =?Utf-8?B?TmVpbCBHb2xkd2Fzc2Vy?= Microsoft Excel Programming 3 25th Jan 2006 09:07 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:19 AM.