Looping code for an unknown reason!

Discussion in 'ASP General' started by Luke - eat.lemons@gmail.com, Oct 23, 2006.

  1. Luke -

    Luke - Guest

    Hi,

    Im pretty new to asp so all light on this question would be great.

    Basically i need to test to see what value is set (where to retrieve the
    data from) so ive done it like this:

    If Request.Querystring("id") = "" then
    TidF=Request.Form("TidF")
    Else
    TidF=Request.Querystring("id")
    End If

    The data Request.Form("TidF") comes from a form if submit is pressed.

    The data Request.Querystring("id") comes from the url being .asp?id=number

    However it seems to keep looping round even though i have ended the if
    statement and set the var.

    all help would be great thanks.
     
    Luke - , Oct 23, 2006
    #1
    1. Advertising

  2. There's nothing here that would cause a loop. What makes you think
    something's looping?

    Ray at work

    <> wrote in message
    news:...
    > Hi,
    >
    > Im pretty new to asp so all light on this question would be great.
    >
    > Basically i need to test to see what value is set (where to retrieve the
    > data from) so ive done it like this:
    >
    > If Request.Querystring("id") = "" then
    > TidF=Request.Form("TidF")
    > Else
    > TidF=Request.Querystring("id")
    > End If
    >
    > The data Request.Form("TidF") comes from a form if submit is pressed.
    >
    > The data Request.Querystring("id") comes from the url being .asp?id=number
    >
    > However it seems to keep looping round even though i have ended the if
    > statement and set the var.
    >
    > all help would be great thanks.
    >
    >
     
    Ray Costanzo [MVP], Oct 23, 2006
    #2
    1. Advertising

  3. <> wrote in message
    news:...
    > Hi,
    >
    > Im pretty new to asp so all light on this question would be great.
    >
    > Basically i need to test to see what value is set (where to retrieve the
    > data from) so ive done it like this:
    >
    > If Request.Querystring("id") = "" then
    > TidF=Request.Form("TidF")
    > Else
    > TidF=Request.Querystring("id")
    > End If
    >
    > The data Request.Form("TidF") comes from a form if submit is pressed.
    >
    > The data Request.Querystring("id") comes from the url being .asp?id=number
    >
    > However it seems to keep looping round even though i have ended the if
    > statement and set the var.
    >
    > all help would be great thanks.
    >
    >


    There is no way this code can loop. What makes you think it is looping?
     
    Anthony Jones, Oct 23, 2006
    #3
  4. Luke -

    Luke - Guest

    Ray Costanzo [MVP] wrote:
    > There's nothing here that would cause a loop. What makes you think
    > something's looping?
    >
    > Ray at work
    >
    > <> wrote in message
    > news:...
    >> Hi,
    >>
    >> Im pretty new to asp so all light on this question would be great.
    >>
    >> Basically i need to test to see what value is set (where to retrieve the
    >> data from) so ive done it like this:
    >>
    >> If Request.Querystring("id") = "" then
    >> TidF=Request.Form("TidF")
    >> Else
    >> TidF=Request.Querystring("id")
    >> End If
    >>
    >> The data Request.Form("TidF") comes from a form if submit is pressed.
    >>
    >> The data Request.Querystring("id") comes from the url being .asp?id=number
    >>
    >> However it seems to keep looping round even though i have ended the if
    >> statement and set the var.
    >>
    >> all help would be great thanks.
    >>
    >>

    >
    >

    At a certain point the code seems to loop round the whole script and
    dosent halt ever since ive added in them lines.

    Here is my code:

    http://rafb.net/paste/results/qXOfJn50.html

    Thanks agian.
     
    Luke - , Oct 23, 2006
    #4
  5. The only loop you have in your code starts on line 99. And best as I can
    tell, you'll loop through there just fine. (Although I am wondering why you
    don't have " AND filled='Y'" in your query.) Inside of your loop, say at
    line 100, put this:

    Response.Write "In the loop.<hr>"
    Response.Flush

    What do you see when you load the page?

    Ray at work






    <> wrote in message
    news:...
    > Ray Costanzo [MVP] wrote:
    >> There's nothing here that would cause a loop. What makes you think
    >> something's looping?
    >>
    >> Ray at work
    >>
    >> <> wrote in message
    >> news:...
    >>> Hi,
    >>>
    >>> Im pretty new to asp so all light on this question would be great.
    >>>
    >>> Basically i need to test to see what value is set (where to retrieve the
    >>> data from) so ive done it like this:
    >>>
    >>> If Request.Querystring("id") = "" then
    >>> TidF=Request.Form("TidF")
    >>> Else
    >>> TidF=Request.Querystring("id")
    >>> End If
    >>>
    >>> The data Request.Form("TidF") comes from a form if submit is pressed.
    >>>
    >>> The data Request.Querystring("id") comes from the url being
    >>> .asp?id=number
    >>>
    >>> However it seems to keep looping round even though i have ended the if
    >>> statement and set the var.
    >>>
    >>> all help would be great thanks.
    >>>
    >>>

    >>
    >>

    > At a certain point the code seems to loop round the whole script and
    > dosent halt ever since ive added in them lines.
    >
    > Here is my code:
    >
    > http://rafb.net/paste/results/qXOfJn50.html
    >
    > Thanks agian.
     
    Ray Costanzo [MVP], Oct 23, 2006
    #5
  6. wrote:
    > Ray Costanzo [MVP] wrote:
    >> There's nothing here that would cause a loop. What makes you think
    >> something's looping?
    >>
    >> Ray at work
    >>
    >> <> wrote in message
    >> news:...
    >>> Hi,
    >>>
    >>> Im pretty new to asp so all light on this question would be great.
    >>>
    >>> Basically i need to test to see what value is set (where to
    >>> retrieve the data from) so ive done it like this:
    >>>
    >>> If Request.Querystring("id") = "" then
    >>> TidF=Request.Form("TidF")
    >>> Else
    >>> TidF=Request.Querystring("id")
    >>> End If
    >>>
    >>> The data Request.Form("TidF") comes from a form if submit is
    >>> pressed. The data Request.Querystring("id") comes from the url being
    >>> .asp?id=number However it seems to keep looping round even though i have
    >>> ended the
    >>> if statement and set the var.
    >>>
    >>> all help would be great thanks.
    >>>
    >>>

    >>
    >>

    > At a certain point the code seems to loop round the whole script and
    > dosent halt ever since ive added in them lines.
    >
    > Here is my code:
    >
    > http://rafb.net/paste/results/qXOfJn50.html
    >

    Well obviously we cannot test your code to see the symptoms that lead you to
    believe that you have an infinite loop, so you're going to have to help us
    out. Start by showing us the source of the page that results from running
    this code. Put in some response.writes of your variable values at various
    places so we can see what is happening.

    Having said that, your coding practices could use some work (yes, I know you
    are new to this ... this is not destructive criticicsm: it's intended as
    constructive). These do not have anything to do with your problem (I think),
    but you should address them:

    1. Your connection string - http://www.aspfaq.com/show.asp?id=2126
    2. Selstar - http://www.aspfaq.com/show.asp?id=2096
    3.Costly recordset loop - http://www.aspfaq.com/show.asp?id=2467
    4. Major:problem:
    Your use of dynamic sql is leaving you vulnerable to hackers using sql
    injection:
    http://mvp.unixwiz.net/techtips/sql-injection.html
    http://www.sqlsecurity.com/DesktopDefault.aspx?tabid=23

    See here for a better, more secure way to execute your queries by using
    parameter markers:
    http://groups-beta.google.com/group/microsoft.public.inetserver.asp.db/msg/72e36562fee7804e

    Personally, I prefer using stored procedures, or saved parameter queries as
    they are known in Access:

    http://www.google.com/groups?hl=en&lr=&ie=UTF-8&oe=UTF-8&selm=

    http://groups.google.com/groups?hl=...=1&selm=


    --
    Microsoft MVP - ASP/ASP.NET
    Please reply to the newsgroup. This email account is my spam trap so I
    don't check it very often. If you must reply off-line, then remove the
    "NO SPAM"
     
    Bob Barrows [MVP], Oct 23, 2006
    #6
  7. Luke -

    Luke - Guest

    Ray Costanzo [MVP] wrote:
    > The only loop you have in your code starts on line 99. And best as I can
    > tell, you'll loop through there just fine. (Although I am wondering why you
    > don't have " AND filled='Y'" in your query.) Inside of your loop, say at
    > line 100, put this:
    >
    > Response.Write "In the loop.<hr>"
    > Response.Flush
    >
    > What do you see when you load the page?
    >
    > Ray at work
    >
    >
    >
    >
    >
    >
    > <> wrote in message
    > news:...
    >> Ray Costanzo [MVP] wrote:
    >>> There's nothing here that would cause a loop. What makes you think
    >>> something's looping?
    >>>
    >>> Ray at work
    >>>
    >>> <> wrote in message
    >>> news:...
    >>>> Hi,
    >>>>
    >>>> Im pretty new to asp so all light on this question would be great.
    >>>>
    >>>> Basically i need to test to see what value is set (where to retrieve the
    >>>> data from) so ive done it like this:
    >>>>
    >>>> If Request.Querystring("id") = "" then
    >>>> TidF=Request.Form("TidF")
    >>>> Else
    >>>> TidF=Request.Querystring("id")
    >>>> End If
    >>>>
    >>>> The data Request.Form("TidF") comes from a form if submit is pressed.
    >>>>
    >>>> The data Request.Querystring("id") comes from the url being
    >>>> .asp?id=number
    >>>>
    >>>> However it seems to keep looping round even though i have ended the if
    >>>> statement and set the var.
    >>>>
    >>>> all help would be great thanks.
    >>>>
    >>>>
    >>>

    >> At a certain point the code seems to loop round the whole script and
    >> dosent halt ever since ive added in them lines.
    >>
    >> Here is my code:
    >>
    >> http://rafb.net/paste/results/qXOfJn50.html
    >>
    >> Thanks agian.

    >
    >

    Hi,

    Unfortunately that didn't work.

    Heres 2 links to videos that explain this abit better!

    http://another-site.net/working.avi

    http://another-site.net/failed.avi

    The first one (working.avi) shows it functional when you use a number
    other than 99999. This number is used to manually prompt for a
    javascript input box that posts the data back to the page. It works but
    it seems to loop round and keep logging in and out.

    Thanks agian.
     
    Luke - , Oct 23, 2006
    #7
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Alexey J.1001958768
    Replies:
    1
    Views:
    702
    Alexey J.1001958768
    Nov 5, 2004
  2. Milsnips
    Replies:
    4
    Views:
    413
    Juan T. Llibre
    Apr 3, 2007
  3. Sharke
    Replies:
    0
    Views:
    289
    Sharke
    Dec 14, 2007
  4. Vincent Arnoux
    Replies:
    1
    Views:
    261
    Arnaud Bergeron
    Aug 11, 2006
  5. Replies:
    5
    Views:
    289
Loading...

Share This Page