Delay page - how?

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

    Delay page - how?

    When my users type in a search parameter on my website, I want the search to
    execute. While it's executing, I want a temporary page to be loaded, with
    perhaps an advert, and when the search actually completes, the search
    results are displayed.

    It's like on orbitz or hotwire, when you search and they show you some
    messages while it's searching.

    Any clues on how I'd do that?

    Thanks,
    Z


  • michel

    #2
    Re: Delay page - how?

    is that of any use at all?
    If a search takes long enough for me to actually pay attention to the
    advert.... the little cross at the right top corner of the browserwindow
    would be clicked on... instantly.

    Michel

    "OneSolutio n" <onesolution@sb cglobal.net> wrote in message
    news:tkyvc.2489 $kp2.2141@newss vr24.news.prodi gy.com...[color=blue]
    > When my users type in a search parameter on my website, I want the search[/color]
    to[color=blue]
    > execute. While it's executing, I want a temporary page to be loaded, with
    > perhaps an advert, and when the search actually completes, the search
    > results are displayed.
    >
    > It's like on orbitz or hotwire, when you search and they show you some
    > messages while it's searching.
    >
    > Any clues on how I'd do that?
    >
    > Thanks,
    > Z
    >
    >[/color]


    Comment

    • OneSolution

      #3
      Re: Delay page - how?

      Ok, that's great to know. But how do I do it then?


      "michel" <no@spam.please > wrote in message
      news:c9mf6l$vui $1@news.cistron .nl...[color=blue]
      > is that of any use at all?
      > If a search takes long enough for me to actually pay attention to the
      > advert.... the little cross at the right top corner of the browserwindow
      > would be clicked on... instantly.
      >
      > Michel
      >
      > "OneSolutio n" <onesolution@sb cglobal.net> wrote in message
      > news:tkyvc.2489 $kp2.2141@newss vr24.news.prodi gy.com...[color=green]
      > > When my users type in a search parameter on my website, I want the[/color][/color]
      search[color=blue]
      > to[color=green]
      > > execute. While it's executing, I want a temporary page to be loaded,[/color][/color]
      with[color=blue][color=green]
      > > perhaps an advert, and when the search actually completes, the search
      > > results are displayed.
      > >
      > > It's like on orbitz or hotwire, when you search and they show you some
      > > messages while it's searching.
      > >
      > > Any clues on how I'd do that?
      > >
      > > Thanks,
      > > Z
      > >
      > >[/color]
      >
      >[/color]


      Comment

      • michel

        #4
        Re: Delay page - how?

        You can print the advert with
        <?php

        $advert="somecl ickableadvert-html";
        print $advert;flush() ;

        //now search

        //end search

        print $results

        ?>

        flush would send it to the browser and the script continues.
        After completion, you can show the results.
        The advert stays in this case, even when the search completed, but the
        again, it might convert into sales at any point, so no worries there, I
        suppose?

        Greetz,

        Mich




        "OneSolutio n" <onesolution@sb cglobal.net> wrote in message
        news:Mrzvc.2495 $FC2.1380@newss vr24.news.prodi gy.com...[color=blue]
        > Ok, that's great to know. But how do I do it then?
        >
        >
        > "michel" <no@spam.please > wrote in message
        > news:c9mf6l$vui $1@news.cistron .nl...[color=green]
        > > is that of any use at all?
        > > If a search takes long enough for me to actually pay attention to the
        > > advert.... the little cross at the right top corner of the browserwindow
        > > would be clicked on... instantly.
        > >
        > > Michel
        > >
        > > "OneSolutio n" <onesolution@sb cglobal.net> wrote in message
        > > news:tkyvc.2489 $kp2.2141@newss vr24.news.prodi gy.com...[color=darkred]
        > > > When my users type in a search parameter on my website, I want the[/color][/color]
        > search[color=green]
        > > to[color=darkred]
        > > > execute. While it's executing, I want a temporary page to be loaded,[/color][/color]
        > with[color=green][color=darkred]
        > > > perhaps an advert, and when the search actually completes, the search
        > > > results are displayed.
        > > >
        > > > It's like on orbitz or hotwire, when you search and they show you some
        > > > messages while it's searching.
        > > >
        > > > Any clues on how I'd do that?
        > > >
        > > > Thanks,
        > > > Z
        > > >
        > > >[/color]
        > >
        > >[/color]
        >
        >[/color]


        Comment

        • OneSolution

          #5
          Re: Delay page - how?

          Thanks. So the flush() will make the advert HTML display, and then I
          suppose the browser icon (on the top right) will keep spinning. Then the
          rest of the code will then execute, and then would I be able to bounce the
          user onto a next page that will display the results of the search? For
          example, by using the header() function?

          Thanks,
          Z



          "michel" <no@spam.please > wrote in message
          news:c9moju$ae3 $1@news.cistron .nl...[color=blue]
          > You can print the advert with
          > <?php
          >
          > $advert="somecl ickableadvert-html";
          > print $advert;flush() ;
          >
          > //now search
          >
          > //end search
          >
          > print $results
          >
          > ?>
          >
          > flush would send it to the browser and the script continues.
          > After completion, you can show the results.
          > The advert stays in this case, even when the search completed, but the
          > again, it might convert into sales at any point, so no worries there, I
          > suppose?
          >
          > Greetz,
          >
          > Mich
          >
          >
          >
          >
          > "OneSolutio n" <onesolution@sb cglobal.net> wrote in message
          > news:Mrzvc.2495 $FC2.1380@newss vr24.news.prodi gy.com...[color=green]
          > > Ok, that's great to know. But how do I do it then?
          > >
          > >
          > > "michel" <no@spam.please > wrote in message
          > > news:c9mf6l$vui $1@news.cistron .nl...[color=darkred]
          > > > is that of any use at all?
          > > > If a search takes long enough for me to actually pay attention to the
          > > > advert.... the little cross at the right top corner of the[/color][/color][/color]
          browserwindow[color=blue][color=green][color=darkred]
          > > > would be clicked on... instantly.
          > > >
          > > > Michel
          > > >
          > > > "OneSolutio n" <onesolution@sb cglobal.net> wrote in message
          > > > news:tkyvc.2489 $kp2.2141@newss vr24.news.prodi gy.com...
          > > > > When my users type in a search parameter on my website, I want the[/color]
          > > search[color=darkred]
          > > > to
          > > > > execute. While it's executing, I want a temporary page to be[/color][/color][/color]
          loaded,[color=blue][color=green]
          > > with[color=darkred]
          > > > > perhaps an advert, and when the search actually completes, the[/color][/color][/color]
          search[color=blue][color=green][color=darkred]
          > > > > results are displayed.
          > > > >
          > > > > It's like on orbitz or hotwire, when you search and they show you[/color][/color][/color]
          some[color=blue][color=green][color=darkred]
          > > > > messages while it's searching.
          > > > >
          > > > > Any clues on how I'd do that?
          > > > >
          > > > > Thanks,
          > > > > Z
          > > > >
          > > > >
          > > >
          > > >[/color]
          > >
          > >[/color]
          >
          >[/color]


          Comment

          • FLEB

            #6
            Re: Delay page - how?

            Regarding this well-known quote, often attributed to OneSolution's famous
            "Thu, 03 Jun 2004 19:01:25 GMT" speech:
            [color=blue]
            > Thanks. So the flush() will make the advert HTML display, and then I
            > suppose the browser icon (on the top right) will keep spinning. Then the
            > rest of the code will then execute, and then would I be able to bounce the
            > user onto a next page that will display the results of the search? For
            > example, by using the header() function?
            >
            > Thanks,
            > Z
            >
            >
            >
            > "michel" <no@spam.please > wrote in message
            > news:c9moju$ae3 $1@news.cistron .nl...[color=green]
            >> You can print the advert with
            >> <?php
            >>
            >> $advert="somecl ickableadvert-html";
            >> print $advert;flush() ;
            >>
            >> //now search
            >>
            >> //end search
            >>
            >> print $results
            >>
            >> ?>
            >>
            >> flush would send it to the browser and the script continues.
            >> After completion, you can show the results.
            >> The advert stays in this case, even when the search completed, but the
            >> again, it might convert into sales at any point, so no worries there, I
            >> suppose?
            >>
            >> Greetz,
            >>
            >> Mich
            >>
            >>
            >>
            >>
            >> "OneSolutio n" <onesolution@sb cglobal.net> wrote in message
            >> news:Mrzvc.2495 $FC2.1380@newss vr24.news.prodi gy.com...[color=darkred]
            >>> Ok, that's great to know. But how do I do it then?
            >>>
            >>>
            >>> "michel" <no@spam.please > wrote in message
            >>> news:c9mf6l$vui $1@news.cistron .nl...
            >>> > is that of any use at all?
            >>> > If a search takes long enough for me to actually pay attention to the
            >>> > advert.... the little cross at the right top corner of the[/color][/color]
            > browserwindow[color=green][color=darkred]
            >>> > would be clicked on... instantly.
            >>> >
            >>> > Michel
            >>> >
            >>> > "OneSolutio n" <onesolution@sb cglobal.net> wrote in message
            >>> > news:tkyvc.2489 $kp2.2141@newss vr24.news.prodi gy.com...
            >>> > > When my users type in a search parameter on my website, I want the
            >>> search
            >>> > to
            >>> > > execute. While it's executing, I want a temporary page to be[/color][/color]
            > loaded,[color=green][color=darkred]
            >>> with
            >>> > > perhaps an advert, and when the search actually completes, the[/color][/color]
            > search[color=green][color=darkred]
            >>> > > results are displayed.
            >>> > >
            >>> > > It's like on orbitz or hotwire, when you search and they show you[/color][/color]
            > some[color=green][color=darkred]
            >>> > > messages while it's searching.
            >>> > >
            >>> > > Any clues on how I'd do that?
            >>> > >
            >>> > > Thanks,
            >>> > > Z
            >>> > >
            >>> > >
            >>> >
            >>> >
            >>>
            >>>[/color]
            >>
            >>[/color][/color]

            Nope. You can't header() after you've output anything to the browser.

            I'd recommend a multi-purpose page running as one PHP file:

            if (the search is done) {
            display the results...
            } else {
            header("Refresh : 2"); // wait 2 seconds and reload
            display the ad...
            }

            A few include()s later, and I imagine you could even make it look nice and
            work well.

            --
            -- Rudy Fleminger
            -- sp@mmers.and.ev il.ones.will.bo w-down-to.us
            (put "Hey!" in the Subject line for priority processing!)
            -- http://www.pixelsaredead.com

            Comment

            • michel

              #7
              Re: Delay page - how?

              Bounce to next page is not possible using header, since the header is sent
              when displaying the advert.
              however, you can still shoot the browser a javascript that does the
              redirecting for you.
              And a link for the users that have javascript unavailable to their browsers.

              Greetz,

              Michel

              "OneSolutio n" <onesolution@sb cglobal.net> wrote in message
              news:9AKvc.2557 $He5.2541@newss vr24.news.prodi gy.com...[color=blue]
              > Thanks. So the flush() will make the advert HTML display, and then I
              > suppose the browser icon (on the top right) will keep spinning. Then the
              > rest of the code will then execute, and then would I be able to bounce the
              > user onto a next page that will display the results of the search? For
              > example, by using the header() function?
              >
              > Thanks,
              > Z
              >
              >
              >
              > "michel" <no@spam.please > wrote in message
              > news:c9moju$ae3 $1@news.cistron .nl...[color=green]
              > > You can print the advert with
              > > <?php
              > >
              > > $advert="somecl ickableadvert-html";
              > > print $advert;flush() ;
              > >
              > > //now search
              > >
              > > //end search
              > >
              > > print $results
              > >
              > > ?>
              > >
              > > flush would send it to the browser and the script continues.
              > > After completion, you can show the results.
              > > The advert stays in this case, even when the search completed, but the
              > > again, it might convert into sales at any point, so no worries there, I
              > > suppose?
              > >
              > > Greetz,
              > >
              > > Mich
              > >
              > >
              > >
              > >
              > > "OneSolutio n" <onesolution@sb cglobal.net> wrote in message
              > > news:Mrzvc.2495 $FC2.1380@newss vr24.news.prodi gy.com...[color=darkred]
              > > > Ok, that's great to know. But how do I do it then?
              > > >
              > > >
              > > > "michel" <no@spam.please > wrote in message
              > > > news:c9mf6l$vui $1@news.cistron .nl...
              > > > > is that of any use at all?
              > > > > If a search takes long enough for me to actually pay attention to[/color][/color][/color]
              the[color=blue][color=green][color=darkred]
              > > > > advert.... the little cross at the right top corner of the[/color][/color]
              > browserwindow[color=green][color=darkred]
              > > > > would be clicked on... instantly.
              > > > >
              > > > > Michel
              > > > >
              > > > > "OneSolutio n" <onesolution@sb cglobal.net> wrote in message
              > > > > news:tkyvc.2489 $kp2.2141@newss vr24.news.prodi gy.com...
              > > > > > When my users type in a search parameter on my website, I want the
              > > > search
              > > > > to
              > > > > > execute. While it's executing, I want a temporary page to be[/color][/color]
              > loaded,[color=green][color=darkred]
              > > > with
              > > > > > perhaps an advert, and when the search actually completes, the[/color][/color]
              > search[color=green][color=darkred]
              > > > > > results are displayed.
              > > > > >
              > > > > > It's like on orbitz or hotwire, when you search and they show you[/color][/color]
              > some[color=green][color=darkred]
              > > > > > messages while it's searching.
              > > > > >
              > > > > > Any clues on how I'd do that?
              > > > > >
              > > > > > Thanks,
              > > > > > Z
              > > > > >
              > > > > >
              > > > >
              > > > >
              > > >
              > > >[/color]
              > >
              > >[/color]
              >
              >[/color]


              Comment

              • michel

                #8
                Re: Delay page - how?

                [color=blue]
                > if (the search is done) {
                > display the results...
                > } else {
                > header("Refresh : 2"); // wait 2 seconds and reload
                > display the ad...
                > }
                >[/color]

                Not a nice solution. it will run multiple instances of the same script ..
                this will result in problems, definitely.

                Michel


                Comment

                • FLEB

                  #9
                  Re: Delay page - how?

                  Regarding this well-known quote, often attributed to michel's famous "Fri,
                  4 Jun 2004 10:40:49 +0200" speech:
                  [color=blue][color=green]
                  >> if (the search is done) {
                  >> display the results...
                  >> } else {
                  >> header("Refresh : 2"); // wait 2 seconds and reload
                  >> display the ad...
                  >> }
                  >>[/color]
                  >
                  > Not a nice solution. it will run multiple instances of the same script ..
                  > this will result in problems, definitely.
                  >
                  > Michel[/color]

                  I don't follow you. If the actual searching mechanism isn't in this script,
                  just a simple "check if it's done" method, how would this run multiple
                  instances, especially if the Refresh timeout is 2 seconds?

                  --
                  -- Rudy Fleminger
                  -- sp@mmers.and.ev il.ones.will.bo w-down-to.us
                  (put "Hey!" in the Subject line for priority processing!)
                  -- http://www.pixelsaredead.com

                  Comment

                  • Chung Leong

                    #10
                    Re: Delay page - how?

                    "OneSolutio n" <onesolution@sb cglobal.net> wrote in message
                    news:9AKvc.2557 $He5.2541@newss vr24.news.prodi gy.com...[color=blue]
                    > Thanks. So the flush() will make the advert HTML display, and then I
                    > suppose the browser icon (on the top right) will keep spinning. Then the
                    > rest of the code will then execute, and then would I be able to bounce the
                    > user onto a next page that will display the results of the search? For
                    > example, by using the header() function?[/color]

                    No, the same script will display the advert HTML, perform the search, and
                    display the result:

                    <?

                    ShowAdvertiseme nt();

                    // do search here

                    HideAdvertiseme nt();

                    // print the result

                    ?>

                    The Show/HideAdvertiseme nt functions could look like this:

                    <?

                    function ShowAdvertiseme nt() {
                    echo '<div id="billboard"> ';
                    readfile("adver t.html");
                    echo '</div>';
                    // flush IE's internal buffer with useless data
                    for($i = 0; $i < 200; $i) {
                    echo '<!-- NO COMMENT -->';
                    }
                    flush();
                    }

                    function HideAdvertiseme nt() {
                    echo '<style> #billboard { display: none; } </style>';
                    }

                    ?>


                    Comment

                    • michel

                      #11
                      Re: Delay page - how?

                      'cus you'd also expect more than one visitor on your site?

                      "FLEB" <soon.the.sp@mm ers.and.evil.on es.will.bow-down-to.us> wrote in
                      message news:une8ljy4au i5$.6amnkpgwmw0 3$.dlg@40tude.n et...[color=blue]
                      > Regarding this well-known quote, often attributed to michel's famous "Fri,
                      > 4 Jun 2004 10:40:49 +0200" speech:
                      >[color=green][color=darkred]
                      > >> if (the search is done) {
                      > >> display the results...
                      > >> } else {
                      > >> header("Refresh : 2"); // wait 2 seconds and reload
                      > >> display the ad...
                      > >> }
                      > >>[/color]
                      > >
                      > > Not a nice solution. it will run multiple instances of the same script[/color][/color]
                      ...[color=blue][color=green]
                      > > this will result in problems, definitely.
                      > >
                      > > Michel[/color]
                      >
                      > I don't follow you. If the actual searching mechanism isn't in this[/color]
                      script,[color=blue]
                      > just a simple "check if it's done" method, how would this run multiple
                      > instances, especially if the Refresh timeout is 2 seconds?
                      >
                      > --
                      > -- Rudy Fleminger
                      > -- sp@mmers.and.ev il.ones.will.bo w-down-to.us
                      > (put "Hey!" in the Subject line for priority processing!)
                      > -- http://www.pixelsaredead.com[/color]


                      Comment

                      Working...