Simple question I hope!

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

    Simple question I hope!

    Hi
    I want to write a form that when a user presses submit it carries out the
    submit action and then closes the browser or redirects to another page.

    The form CGI I'm using, Demon's does not allow this and the default page and
    message is , well, crap!

    Can this be done?

    Thanks

    Adrian


  • orlando echevarria

    #2
    Re: Simple question I hope!

    Yes, it can be:

    Part I

    <!--- test.html --->
    <html>
    <head>
    <title>Test</title>
    </head>
    <body>
    <form name="adrianFrm " action ="/cgi-bin/myscript.cgi" method = "post">
    <input type = "submit" value = "Send">
    </form>
    </body>
    </html>



    Part II

    <!--- mysqcript.cgi --->
    <!--- make sure your script outputs the following --->
    <html>
    <head>
    <title>Test</title>
    <meta name = "http-equiv" content = "0;url=http ://www.mysite.com/">
    </head>
    <body>
    <p>Click here to <a href = "http://www.mysite.com/">continue</a></p>
    </body>
    </html>

    Adrian wrote:[color=blue]
    > Hi
    > I want to write a form that when a user presses submit it carries out the
    > submit action and then closes the browser or redirects to another page.
    >
    > The form CGI I'm using, Demon's does not allow this and the default page and
    > message is , well, crap!
    >
    > Can this be done?
    >
    > Thanks
    >
    > Adrian
    >
    >[/color]

    Comment

    • Adrian

      #3
      Re: Simple question I hope!

      Hi
      Thanks, but I my isp provide a preset script that I can't modify only
      call, so I'm trying to do it from JS within the page!

      Adrian

      "orlando echevarria" <orlando@engr.u conn.edu> wrote in message
      news:3F6B46CE.4 020103@engr.uco nn.edu...[color=blue]
      > Yes, it can be:
      >
      > Part I
      >
      > <!--- test.html --->
      > <html>
      > <head>
      > <title>Test</title>
      > </head>
      > <body>
      > <form name="adrianFrm " action ="/cgi-bin/myscript.cgi" method = "post">
      > <input type = "submit" value = "Send">
      > </form>
      > </body>
      > </html>
      >
      >
      >
      > Part II
      >
      > <!--- mysqcript.cgi --->
      > <!--- make sure your script outputs the following --->
      > <html>
      > <head>
      > <title>Test</title>
      > <meta name = "http-equiv" content = "0;url=http ://www.mysite.com/">
      > </head>
      > <body>
      > <p>Click here to <a href = "http://www.mysite.com/">continue</a></p>
      > </body>
      > </html>
      >
      > Adrian wrote:[color=green]
      > > Hi
      > > I want to write a form that when a user presses submit it carries out[/color][/color]
      the[color=blue][color=green]
      > > submit action and then closes the browser or redirects to another page.
      > >
      > > The form CGI I'm using, Demon's does not allow this and the default page[/color][/color]
      and[color=blue][color=green]
      > > message is , well, crap!
      > >
      > > Can this be done?
      > >
      > > Thanks
      > >
      > > Adrian
      > >
      > >[/color]
      >[/color]


      Comment

      • The Plankmeister

        #4
        Re: Simple question I hope!

        [color=blue]
        > I want to write a form that when a user presses submit it carries out the
        > submit action and then closes the browser or redirects to another page.[/color]

        If I understand you correctly, then you want the form processing to be done
        on the page locally, rather than on the server?

        If so... well... It is possible to write a javascript function to 'validate'
        the form and perform pretty much any 'local' operations of the info...
        However, usually for a form to be of any use it needs to send its data to
        the server.

        If all you want to do is rewrite the form in a fancy way so that it looks
        nice, you can do that and still submit the form data to the cgi script.
        However, getting it to redirect to another page after submission is another
        matter... I'm pretty sure that you cannot change that behaviour, as upon
        processing the cgi script, its output is sent to the browser directly. So
        unless you can modify the cgi script, you're stuck. Unless there is a
        parameter you can pass to the cgi script that will redirect it somewhere.
        Which is doubtful.

        HTH.

        P.


        Comment

        • Adrian

          #5
          Re: Simple question I hope!

          Hi
          Thanks, the redirect in your second scenario is what I'm trying to
          achieve or if not a redirect, to submit the from and then close the window
          before it receives a reply.

          Thanks

          Adrian


          "The Plankmeister" <plankmeister_N OSPAM_@hotmail. com> wrote in message
          news:3f6b5124$0 $32479$edfadb0f @dread16.news.t ele.dk...[color=blue]
          >[color=green]
          > > I want to write a form that when a user presses submit it carries out[/color][/color]
          the[color=blue][color=green]
          > > submit action and then closes the browser or redirects to another page.[/color]
          >
          > If I understand you correctly, then you want the form processing to be[/color]
          done[color=blue]
          > on the page locally, rather than on the server?
          >
          > If so... well... It is possible to write a javascript function to[/color]
          'validate'[color=blue]
          > the form and perform pretty much any 'local' operations of the info...
          > However, usually for a form to be of any use it needs to send its data to
          > the server.
          >
          > If all you want to do is rewrite the form in a fancy way so that it looks
          > nice, you can do that and still submit the form data to the cgi script.
          > However, getting it to redirect to another page after submission is[/color]
          another[color=blue]
          > matter... I'm pretty sure that you cannot change that behaviour, as upon
          > processing the cgi script, its output is sent to the browser directly. So
          > unless you can modify the cgi script, you're stuck. Unless there is a
          > parameter you can pass to the cgi script that will redirect it somewhere.
          > Which is doubtful.
          >
          > HTH.
          >
          > P.
          >
          >[/color]


          Comment

          • Eric Klein

            #6
            Re: Simple question I hope!

            If you are using the formail.pl script, the hidden field is "redirect".

            Eric Klein
            eric.klein@mssm .edu



            "The Plankmeister" <plankmeister_N OSPAM_@hotmail. com> wrote in message news:<3f6b5124$ 0$32479$edfadb0 f@dread16.news. tele.dk>...[color=blue]
            > Unless there is a
            > parameter you can pass to the cgi script that will redirect it somewhere.
            > Which is doubtful.
            >
            > HTH.
            >
            > P.[/color]

            Comment

            • Eric Klein

              #7
              Re: Simple question I hope!

              If you are using formail.pl, the hidden field is called "redirect".

              Eric Klein
              <a href="mailto:er ic.klein@mssm.e du>eric.klein@m ssm.edu</a>
              <a href="http://www.mssm.edu/students/kleine04">http://www.mssm.edu/students/kleine04</a>


              "The Plankmeister" <plankmeister_N OSPAM_@hotmail. com> wrote in message news:<3f6b5124$ 0$32479$edfadb0 f@dread16.news. tele.dk>...[color=blue][color=green]
              > > I want to write a form that when a user presses submit it carries out the
              > > submit action and then closes the browser or redirects to another page.[/color]
              >
              > If I understand you correctly, then you want the form processing to be done
              > on the page locally, rather than on the server?
              >
              > If so... well... It is possible to write a javascript function to 'validate'
              > the form and perform pretty much any 'local' operations of the info...
              > However, usually for a form to be of any use it needs to send its data to
              > the server.
              >
              > If all you want to do is rewrite the form in a fancy way so that it looks
              > nice, you can do that and still submit the form data to the cgi script.
              > However, getting it to redirect to another page after submission is another
              > matter... I'm pretty sure that you cannot change that behaviour, as upon
              > processing the cgi script, its output is sent to the browser directly. So
              > unless you can modify the cgi script, you're stuck. Unless there is a
              > parameter you can pass to the cgi script that will redirect it somewhere.
              > Which is doubtful.
              >
              > HTH.
              >
              > P.[/color]

              Comment

              • Adrian

                #8
                Re: Simple question I hope!

                Hi,
                Thanks but I guess its not formail.pl as redirect didn't work!

                The form tag is :
                <form action="/cgi-bin/mailform" method="get">

                And the ISP is www.demon.net

                if that helps

                Thanks

                Adrian

                "Eric Klein" <eric.klein@mss m.edu> wrote in message
                news:16d9a0a6.0 309191505.63408 3fb@posting.goo gle.com...[color=blue]
                > If you are using formail.pl, the hidden field is called "redirect".
                >
                > Eric Klein
                > <a href="mailto:er ic.klein@mssm.e du>eric.klein@m ssm.edu</a>
                > <a[/color]
                href="http://www.mssm.edu/students/kleine04">http://www.mssm.edu/students/kl
                eine04</a>[color=blue]
                >
                >
                > "The Plankmeister" <plankmeister_N OSPAM_@hotmail. com> wrote in message[/color]
                news:<3f6b5124$ 0$32479$edfadb0 f@dread16.news. tele.dk>...[color=blue][color=green][color=darkred]
                > > > I want to write a form that when a user presses submit it carries out[/color][/color][/color]
                the[color=blue][color=green][color=darkred]
                > > > submit action and then closes the browser or redirects to another[/color][/color][/color]
                page.[color=blue][color=green]
                > >
                > > If I understand you correctly, then you want the form processing to be[/color][/color]
                done[color=blue][color=green]
                > > on the page locally, rather than on the server?
                > >
                > > If so... well... It is possible to write a javascript function to[/color][/color]
                'validate'[color=blue][color=green]
                > > the form and perform pretty much any 'local' operations of the info...
                > > However, usually for a form to be of any use it needs to send its data[/color][/color]
                to[color=blue][color=green]
                > > the server.
                > >
                > > If all you want to do is rewrite the form in a fancy way so that it[/color][/color]
                looks[color=blue][color=green]
                > > nice, you can do that and still submit the form data to the cgi script.
                > > However, getting it to redirect to another page after submission is[/color][/color]
                another[color=blue][color=green]
                > > matter... I'm pretty sure that you cannot change that behaviour, as upon
                > > processing the cgi script, its output is sent to the browser directly.[/color][/color]
                So[color=blue][color=green]
                > > unless you can modify the cgi script, you're stuck. Unless there is a
                > > parameter you can pass to the cgi script that will redirect it[/color][/color]
                somewhere.[color=blue][color=green]
                > > Which is doubtful.
                > >
                > > HTH.
                > >
                > > P.[/color][/color]


                Comment

                • Eric Klein

                  #9
                  Re: Simple question I hope!

                  for mailform the hidden field should be _1_SuccessDocum ent
                  good luck

                  Eric Klein
                  eric.klein@mssm .edu



                  "Adrian" <Adrian_Gardene r@NOSPAMhotmail .com> wrote in message news:<bkh6qo$eu 8$1$8300dec7@ne ws.demon.co.uk> ...[color=blue]
                  > Hi,
                  > Thanks but I guess its not formail.pl as redirect didn't work!
                  >
                  > The form tag is :
                  > <form action="/cgi-bin/mailform" method="get">
                  >
                  > And the ISP is www.demon.net
                  >
                  > if that helps
                  >
                  > Thanks
                  >
                  > Adrian
                  >
                  > "Eric Klein" <eric.klein@mss m.edu> wrote in message
                  > news:16d9a0a6.0 309191505.63408 3fb@posting.goo gle.com...[color=green]
                  > > If you are using formail.pl, the hidden field is called "redirect".
                  > >
                  > > Eric Klein
                  > > <a href="mailto:er ic.klein@mssm.e du>eric.klein@m ssm.edu</a>
                  > > <a[/color]
                  > href="http://www.mssm.edu/students/kleine04">http://www.mssm.edu/students/kl
                  > eine04</a>[color=green]
                  > >
                  > >
                  > > "The Plankmeister" <plankmeister_N OSPAM_@hotmail. com> wrote in message[/color]
                  > news:<3f6b5124$ 0$32479$edfadb0 f@dread16.news. tele.dk>...[color=green][color=darkred]
                  > > > > I want to write a form that when a user presses submit it carries out[/color][/color]
                  > the[color=green][color=darkred]
                  > > > > submit action and then closes the browser or redirects to another[/color][/color]
                  > page.[color=green][color=darkred]
                  > > >
                  > > > If I understand you correctly, then you want the form processing to be[/color][/color]
                  > done[color=green][color=darkred]
                  > > > on the page locally, rather than on the server?
                  > > >
                  > > > If so... well... It is possible to write a javascript function to[/color][/color]
                  > 'validate'[color=green][color=darkred]
                  > > > the form and perform pretty much any 'local' operations of the info...
                  > > > However, usually for a form to be of any use it needs to send its data[/color][/color]
                  > to[color=green][color=darkred]
                  > > > the server.
                  > > >
                  > > > If all you want to do is rewrite the form in a fancy way so that it[/color][/color]
                  > looks[color=green][color=darkred]
                  > > > nice, you can do that and still submit the form data to the cgi script.
                  > > > However, getting it to redirect to another page after submission is[/color][/color]
                  > another[color=green][color=darkred]
                  > > > matter... I'm pretty sure that you cannot change that behaviour, as upon
                  > > > processing the cgi script, its output is sent to the browser directly.[/color][/color]
                  > So[color=green][color=darkred]
                  > > > unless you can modify the cgi script, you're stuck. Unless there is a
                  > > > parameter you can pass to the cgi script that will redirect it[/color][/color]
                  > somewhere.[color=green][color=darkred]
                  > > > Which is doubtful.
                  > > >
                  > > > HTH.
                  > > >
                  > > > P.[/color][/color][/color]

                  Comment

                  • Adrian

                    #10
                    Re: Simple question I hope!

                    Hi Eric,
                    I have tried:
                    <input type="hidden" name="_1_Succes sDocument"
                    value="http://uk.altavista.co m/">
                    <input type="hidden" name="_1_Succes sDocument" value="index.ht m">

                    Neither had changed the page displayed! did I enter them correctly? If so I
                    guess demon have tweaked their script!

                    Thanks

                    Adrian


                    "Eric Klein" <eric.klein@mss m.edu> wrote in message
                    news:16d9a0a6.0 309201500.77154 025@posting.goo gle.com...[color=blue]
                    > for mailform the hidden field should be _1_SuccessDocum ent
                    > good luck
                    >
                    > Eric Klein
                    > eric.klein@mssm .edu
                    > http://www.mssm.edu/students/kleine04
                    >
                    >
                    > "Adrian" <Adrian_Gardene r@NOSPAMhotmail .com> wrote in message[/color]
                    news:<bkh6qo$eu 8$1$8300dec7@ne ws.demon.co.uk> ...[color=blue][color=green]
                    > > Hi,
                    > > Thanks but I guess its not formail.pl as redirect didn't work!
                    > >
                    > > The form tag is :
                    > > <form action="/cgi-bin/mailform" method="get">
                    > >
                    > > And the ISP is www.demon.net
                    > >
                    > > if that helps
                    > >
                    > > Thanks
                    > >
                    > > Adrian
                    > >
                    > > "Eric Klein" <eric.klein@mss m.edu> wrote in message
                    > > news:16d9a0a6.0 309191505.63408 3fb@posting.goo gle.com...[color=darkred]
                    > > > If you are using formail.pl, the hidden field is called "redirect".
                    > > >
                    > > > Eric Klein
                    > > > <a href="mailto:er ic.klein@mssm.e du>eric.klein@m ssm.edu</a>
                    > > > <a[/color]
                    > >[/color][/color]
                    href="http://www.mssm.edu/students/kleine04">http://www.mssm.edu/students/kl[color=blue][color=green]
                    > > eine04</a>[color=darkred]
                    > > >
                    > > >
                    > > > "The Plankmeister" <plankmeister_N OSPAM_@hotmail. com> wrote in message[/color]
                    > > news:<3f6b5124$ 0$32479$edfadb0 f@dread16.news. tele.dk>...[color=darkred]
                    > > > > > I want to write a form that when a user presses submit it carries[/color][/color][/color]
                    out[color=blue][color=green]
                    > > the[color=darkred]
                    > > > > > submit action and then closes the browser or redirects to another[/color]
                    > > page.[color=darkred]
                    > > > >
                    > > > > If I understand you correctly, then you want the form processing to[/color][/color][/color]
                    be[color=blue][color=green]
                    > > done[color=darkred]
                    > > > > on the page locally, rather than on the server?
                    > > > >
                    > > > > If so... well... It is possible to write a javascript function to[/color]
                    > > 'validate'[color=darkred]
                    > > > > the form and perform pretty much any 'local' operations of the[/color][/color][/color]
                    info...[color=blue][color=green][color=darkred]
                    > > > > However, usually for a form to be of any use it needs to send its[/color][/color][/color]
                    data[color=blue][color=green]
                    > > to[color=darkred]
                    > > > > the server.
                    > > > >
                    > > > > If all you want to do is rewrite the form in a fancy way so that it[/color]
                    > > looks[color=darkred]
                    > > > > nice, you can do that and still submit the form data to the cgi[/color][/color][/color]
                    script.[color=blue][color=green][color=darkred]
                    > > > > However, getting it to redirect to another page after submission is[/color]
                    > > another[color=darkred]
                    > > > > matter... I'm pretty sure that you cannot change that behaviour, as[/color][/color][/color]
                    upon[color=blue][color=green][color=darkred]
                    > > > > processing the cgi script, its output is sent to the browser[/color][/color][/color]
                    directly.[color=blue][color=green]
                    > > So[color=darkred]
                    > > > > unless you can modify the cgi script, you're stuck. Unless there is[/color][/color][/color]
                    a[color=blue][color=green][color=darkred]
                    > > > > parameter you can pass to the cgi script that will redirect it[/color]
                    > > somewhere.[color=darkred]
                    > > > > Which is doubtful.
                    > > > >
                    > > > > HTH.
                    > > > >
                    > > > > P.[/color][/color][/color]


                    Comment

                    • Grant Wagner

                      #11
                      Re: Simple question I hope!

                      Find out precisely what script your ISP is using. Yes, it's called "mailform",
                      but is it "mailform.p l" that's described here: <url:
                      http://cyberbuzz.gatech.edu/support/cgi_mailform.html />

                      If so, then you simply need to read the documentation:

                      Field: REDIRECT

                      Description:
                      If you wish to redirect the user to a different URL, rather than having them
                      see the default response to the fill-out form, you can use this hidden variable
                      to send them to a pre-made HTML page.

                      Syntax:
                      To choose the URL they will end up at:
                      <input type=hidden name="redirect"
                      value="http://your.host.com/to/file.html">
                      To allow them to specify a URL they wish to travel to once the form is
                      filled out:
                      <input type=text name="redirect" >

                      Or, if you prefer, the documentation here: <url:
                      http://www.bci.org/info/using_formmailcgi.htm />

                      Google is a wonderful thing: <url:
                      http://www.google.com/search?q=mailform+cgi+redirect />

                      Adrian wrote:
                      [color=blue]
                      > Hi Eric,
                      > I have tried:
                      > <input type="hidden" name="_1_Succes sDocument"
                      > value="http://uk.altavista.co m/">
                      > <input type="hidden" name="_1_Succes sDocument" value="index.ht m">
                      >
                      > Neither had changed the page displayed! did I enter them correctly? If so I
                      > guess demon have tweaked their script!
                      >
                      > Thanks
                      >
                      > Adrian
                      >
                      > "Eric Klein" <eric.klein@mss m.edu> wrote in message
                      > news:16d9a0a6.0 309201500.77154 025@posting.goo gle.com...[color=green]
                      > > for mailform the hidden field should be _1_SuccessDocum ent
                      > > good luck
                      > >
                      > > Eric Klein
                      > > eric.klein@mssm .edu
                      > > http://www.mssm.edu/students/kleine04
                      > >
                      > >
                      > > "Adrian" <Adrian_Gardene r@NOSPAMhotmail .com> wrote in message[/color]
                      > news:<bkh6qo$eu 8$1$8300dec7@ne ws.demon.co.uk> ...[color=green][color=darkred]
                      > > > Hi,
                      > > > Thanks but I guess its not formail.pl as redirect didn't work!
                      > > >
                      > > > The form tag is :
                      > > > <form action="/cgi-bin/mailform" method="get">
                      > > >
                      > > > And the ISP is www.demon.net
                      > > >
                      > > > if that helps
                      > > >
                      > > > Thanks
                      > > >
                      > > > Adrian
                      > > >
                      > > > "Eric Klein" <eric.klein@mss m.edu> wrote in message
                      > > > news:16d9a0a6.0 309191505.63408 3fb@posting.goo gle.com...
                      > > > > If you are using formail.pl, the hidden field is called "redirect".
                      > > > >
                      > > > > Eric Klein
                      > > > > <a href="mailto:er ic.klein@mssm.e du>eric.klein@m ssm.edu</a>
                      > > > > <a
                      > > >[/color][/color]
                      > href="http://www.mssm.edu/students/kleine04">http://www.mssm.edu/students/kl[color=green][color=darkred]
                      > > > eine04</a>
                      > > > >
                      > > > >
                      > > > > "The Plankmeister" <plankmeister_N OSPAM_@hotmail. com> wrote in message
                      > > > news:<3f6b5124$ 0$32479$edfadb0 f@dread16.news. tele.dk>...
                      > > > > > > I want to write a form that when a user presses submit it carries[/color][/color]
                      > out[color=green][color=darkred]
                      > > > the
                      > > > > > > submit action and then closes the browser or redirects to another
                      > > > page.
                      > > > > >
                      > > > > > If I understand you correctly, then you want the form processing to[/color][/color]
                      > be[color=green][color=darkred]
                      > > > done
                      > > > > > on the page locally, rather than on the server?
                      > > > > >
                      > > > > > If so... well... It is possible to write a javascript function to
                      > > > 'validate'
                      > > > > > the form and perform pretty much any 'local' operations of the[/color][/color]
                      > info...[color=green][color=darkred]
                      > > > > > However, usually for a form to be of any use it needs to send its[/color][/color]
                      > data[color=green][color=darkred]
                      > > > to
                      > > > > > the server.
                      > > > > >
                      > > > > > If all you want to do is rewrite the form in a fancy way so that it
                      > > > looks
                      > > > > > nice, you can do that and still submit the form data to the cgi[/color][/color]
                      > script.[color=green][color=darkred]
                      > > > > > However, getting it to redirect to another page after submission is
                      > > > another
                      > > > > > matter... I'm pretty sure that you cannot change that behaviour, as[/color][/color]
                      > upon[color=green][color=darkred]
                      > > > > > processing the cgi script, its output is sent to the browser[/color][/color]
                      > directly.[color=green][color=darkred]
                      > > > So
                      > > > > > unless you can modify the cgi script, you're stuck. Unless there is[/color][/color]
                      > a[color=green][color=darkred]
                      > > > > > parameter you can pass to the cgi script that will redirect it
                      > > > somewhere.
                      > > > > > Which is doubtful.
                      > > > > >
                      > > > > > HTH.
                      > > > > >
                      > > > > > P.[/color][/color][/color]

                      --
                      | Grant Wagner <gwagner@agrico reunited.com>

                      * Client-side Javascript and Netscape 4 DOM Reference available at:
                      *


                      * Internet Explorer DOM Reference available at:
                      *
                      Gain technical skills through documentation and training, earn certifications and connect with the community


                      * Netscape 6/7 DOM Reference available at:
                      * http://www.mozilla.org/docs/dom/domref/
                      * Tips for upgrading JavaScript for Netscape 7 / Mozilla
                      * http://www.mozilla.org/docs/web-deve...upgrade_2.html


                      Comment

                      Working...