String contains ?

Discussion in 'ASP General' started by Greg, Nov 9, 2004.

  1. Greg

    Greg Guest

    Hello,

    If a visitor doesn't put anything in the "Search" text box I'd like them to
    be redirected to where they came from before the search form forwarded them
    to the search.asp page. Therefore I've put the following at the top of
    search.asp to do this.


    The problem is however, that if
    Greg, Nov 9, 2004
    #1
    1. Advertising

  2. Greg

    Greg Guest

    Sorry, didn't finish did i?! Here we go....

    Hello,

    If a visitor doesn't put anything in the "Search" text box I'd like them to
    be redirected to where they came from before the search form forwarded them
    to the search.asp page. Therefore I've put the right stuff at the top of
    search.asp to do this.


    The problem is however, if the last thing they did was search for something
    it will redirect them to the search page, which will redirect them to the
    search page, which will redirect them to the search page etc. and the
    operation times out. I tried to get over this by using a variable passed to
    the search page, if it's the search page that is forwarding it on. If this
    variable was set it would redirect it instead to index.asp - however, it
    caused problems because I was attaching ?StopTimeout=1 to the end of the
    Response.Redirect URL - causing problems if the URL to redirect to already
    contained the ? character and some variables. Essentially I want a way of
    working out if the referring page contains a ? or not, so I know whether I
    have to do ?StopTimeout=1 or &StopTimeout=1 - know what I mean?

    Regards
    Greg
    Greg, Nov 9, 2004
    #2
    1. Advertising

  3. How are you redirecting to previous page? A hidden field on the form you
    pass through?
    Sounds like you need to compare this against your search path and if it's
    the same, don't redirect.

    Think thats what you need to do.

    Stu



    "Greg" <> wrote in message
    news:%23N$...
    > Sorry, didn't finish did i?! Here we go....
    >
    > Hello,
    >
    > If a visitor doesn't put anything in the "Search" text box I'd like them

    to
    > be redirected to where they came from before the search form forwarded

    them
    > to the search.asp page. Therefore I've put the right stuff at the top of
    > search.asp to do this.
    >
    >
    > The problem is however, if the last thing they did was search for

    something
    > it will redirect them to the search page, which will redirect them to the
    > search page, which will redirect them to the search page etc. and the
    > operation times out. I tried to get over this by using a variable passed

    to
    > the search page, if it's the search page that is forwarding it on. If this
    > variable was set it would redirect it instead to index.asp - however, it
    > caused problems because I was attaching ?StopTimeout=1 to the end of the
    > Response.Redirect URL - causing problems if the URL to redirect to already
    > contained the ? character and some variables. Essentially I want a way of
    > working out if the referring page contains a ? or not, so I know whether I
    > have to do ?StopTimeout=1 or &StopTimeout=1 - know what I mean?
    >
    > Regards
    > Greg
    >
    >
    Stuart Palmer, Nov 9, 2004
    #3
  4. Greg

    Hal Rosser Guest

    "Greg" <> wrote in message
    news:...
    > Hello,
    >
    > If a visitor doesn't put anything in the "Search" text box I'd like them

    to
    > be redirected to where they came from before the search form forwarded

    them
    > to the search.asp page. Therefore I've put the following at the top of
    > search.asp to do this.
    >
    >
    > The problem is however, that if
    >


    this problem is best solved with javascript on the client side



    ---
    Outgoing mail is certified Virus Free.
    Checked by AVG anti-virus system (http://www.grisoft.com).
    Version: 6.0.788 / Virus Database: 533 - Release Date: 11/1/2004
    Hal Rosser, Nov 9, 2004
    #4
  5. Greg

    Jeff Dillon Guest

    What? Do you have search.htm and search.asp??

    Where is the search form? Is search.asp the search form?

    Jeff
    "Greg" <> wrote in message
    news:#N$...
    > Sorry, didn't finish did i?! Here we go....
    >
    > Hello,
    >
    > If a visitor doesn't put anything in the "Search" text box I'd like them

    to
    > be redirected to where they came from before the search form forwarded

    them
    > to the search.asp page. Therefore I've put the right stuff at the top of
    > search.asp to do this.
    >
    >
    > The problem is however, if the last thing they did was search for

    something
    > it will redirect them to the search page, which will redirect them to the
    > search page, which will redirect them to the search page etc. and the
    > operation times out. I tried to get over this by using a variable passed

    to
    > the search page, if it's the search page that is forwarding it on. If this
    > variable was set it would redirect it instead to index.asp - however, it
    > caused problems because I was attaching ?StopTimeout=1 to the end of the
    > Response.Redirect URL - causing problems if the URL to redirect to already
    > contained the ? character and some variables. Essentially I want a way of
    > working out if the referring page contains a ? or not, so I know whether I
    > have to do ?StopTimeout=1 or &StopTimeout=1 - know what I mean?
    >
    > Regards
    > Greg
    >
    >
    Jeff Dillon, Nov 10, 2004
    #5
    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.

Share This Page