String contains ?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Greg

    String contains ?

    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

    #2
    Re: String contains ?

    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.Redire ct 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


    Comment

    • Stuart Palmer

      #3
      Re: String contains ?

      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" <tech@jmswebdes igns.com> wrote in message
      news:%23N$1Wmmx EHA.3572@TK2MSF TNGP10.phx.gbl. ..[color=blue]
      > 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[/color]
      to[color=blue]
      > be redirected to where they came from before the search form forwarded[/color]
      them[color=blue]
      > 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[/color]
      something[color=blue]
      > 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[/color]
      to[color=blue]
      > 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.Redire ct 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
      >
      >[/color]


      Comment

      • Hal Rosser

        #4
        Re: String contains ?


        "Greg" <tech@jmswebdes igns.com> wrote in message
        news:eI9qUzfxEH A.3260@TK2MSFTN GP10.phx.gbl...[color=blue]
        > Hello,
        >
        > If a visitor doesn't put anything in the "Search" text box I'd like them[/color]
        to[color=blue]
        > be redirected to where they came from before the search form forwarded[/color]
        them[color=blue]
        > 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
        >[/color]

        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


        Comment

        • Jeff Dillon

          #5
          Re: String contains ?

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

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

          Jeff
          "Greg" <tech@jmswebdes igns.com> wrote in message
          news:#N$1WmmxEH A.3572@TK2MSFTN GP10.phx.gbl...[color=blue]
          > 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[/color]
          to[color=blue]
          > be redirected to where they came from before the search form forwarded[/color]
          them[color=blue]
          > 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[/color]
          something[color=blue]
          > 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[/color]
          to[color=blue]
          > 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.Redire ct 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
          >
          >[/color]


          Comment

          Working...