Loading ...
Sorry, an error occurred while loading the content.
 

RE: [PBML] cgi script

Expand Messages
  • Adrian Stovall
    ... This sounds more like an HTML question than a cgi question, since you can get it to display the IP...you can do several things. If you can use the current
    Message 1 of 8 , Dec 28, 2002
      > -----Original Message-----
      > From: kc2eus <apepper@...> [mailto:apepper@...]
      > Sent: Saturday, December 28, 2002 3:17 PM
      > To: perl-beginner@yahoogroups.com
      > Subject: [PBML] cgi script
      >
      >
      > I'm looking for a way to take a IP address submitted via a form and
      > use that IP address to open a new browser window. ie User submits an
      > IP of 1.2.3.4 when the submit button was pressed a new browser
      > window would open to for example
      > http://1.2.3.4:8080/test.html I'm sure there > is an easy way
      > to do this. I can get it to display
      > what IP has been input but that is as far as I've got.
      >
      > Any ideas ?
      > Andrew
      >
      This sounds more like an HTML question than a cgi question, since you
      can get it to display the IP...you can do several things.

      If you can use the current window, you can make use of the commonly-used
      <META> tag...here's a generic example...

      <META HTTP-EQUIV="refresh"
      content="2;URL=http://www.yoursite.com/newpage.htm">

      the "content=2" part makes it wait 2 seconds before sending you to the
      url. This tag usually goes in the <HEAD> section of the page.

      If you can't do this, you could always build a link for the user to
      click on.

      If it has to be automatic, you can use Javascript and the window.open()
      method to open a new window automatically.

      Hope this helps.



      perl -e "sub Sub{return reverse(@_);}$i='ohce';$_='.$yyye k ca i Xl$yyye
      jX $yyyehto ZfX tq $uQ';s+[
      \$]++g;s-j-P-;s^yyy^r^g;s:i:H:;s!X!!g;s|Z|n|;s*Q*J*;s{q}{s}g;s(f)(A);sys
      tem(join('',Sub(split('',$i))),(join('',Sub(split('')))));"

      To the optimist, the glass is half full.
      To the pessimist, the glass is half empty.
      To the engineer, the glass is twice as big as it needs to be.

      Adrian "Okay, I won't top-post unless it's an emergency" Stovall
    • Octavian Rasnita
      Use the following line: my $location = http://123.123.123.123/ ; print Location: $location n n ; This is the correct syntax if you want to open a new web
      Message 2 of 8 , Dec 28, 2002
        Use the following line:
        my $location = 'http://123.123.123.123/';
        print "Location: $location\n\n";

        This is the correct syntax if you want to open a new web page in the same
        window.
        If you want to open another window, you will need to use Javascript because
        the code have to run on the client's computer for opening that second
        window.

        If you want to open another type of file, not a web page, for example a .zip
        archive, you will better use a meta refresh like:

        <meta http-equiv="refresh" content="0;url=$location">

        This is better because this way the download managers (if the client is
        using such programs) are started and they can download the file.

        Teddy,
        Teddy's Center: http://teddy.fcc.ro/
        Email: orasnita@...

        ----- Original Message -----
        From: <apepper@...>
        To: <perl-beginner@yahoogroups.com>
        Sent: Saturday, December 28, 2002 11:17 PM
        Subject: [PBML] cgi script


        I'm looking for a way to take a IP address submitted via a form and
        use that IP address to open a new browser window. ie User submits an
        IP of 1.2.3.4 when the submit button was pressed a new browser
        window would open to for example http://1.2.3.4:8080/test.html
        I'm sure there is an easy way to do this. I can get it to display
        what IP has been input but that is as far as I've got.

        Any ideas ?
        Andrew



        Unsubscribing info is here:
        http://help.yahoo.com/help/us/groups/groups-32.html

        Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
      • Dinesh V. R.
        #!/usr/bin/perl -w use CGI qw/:standard/; print redirect( http:// . remote_host() . :8080/ ) ; return ; ... This sounds more like an HTML question than a
        Message 3 of 8 , Dec 29, 2002
          #!/usr/bin/perl -w
          use CGI qw/:standard/;

          print redirect( "http://" . remote_host() . ":8080/" ) ;
          return ;


          > -----Original Message-----
          > From: kc2eus <apepper@...> [mailto:apepper@...]
          > Sent: Saturday, December 28, 2002 3:17 PM
          > To: perl-beginner@yahoogroups.com
          > Subject: [PBML] cgi script
          >
          >
          > I'm looking for a way to take a IP address submitted via a form and
          > use that IP address to open a new browser window. ie User submits an
          > IP of 1.2.3.4 when the submit button was pressed a new browser
          > window would open to for example
          > http://1.2.3.4:8080/test.html I'm sure there > is an easy way
          > to do this. I can get it to display
          > what IP has been input but that is as far as I've got.
          >
          > Any ideas ?
          > Andrew
          >
          This sounds more like an HTML question than a cgi question, since you
          can get it to display the IP...you can do several things.

          If you can use the current window, you can make use of the commonly-used
          <META> tag...here's a generic example...

          <META HTTP-EQUIV="refresh"
          content="2;URL=http://www.yoursite.com/newpage.htm">

          the "content=2" part makes it wait 2 seconds before sending you to the
          url. This tag usually goes in the <HEAD> section of the page.

          If you can't do this, you could always build a link for the user to
          click on.

          If it has to be automatic, you can use Javascript and the window.open()
          method to open a new window automatically.

          Hope this helps.



          perl -e "sub Sub{return reverse(@_);}$i='ohce';$_='.$yyye k ca i Xl$yyye
          jX $yyyehto ZfX tq $uQ';s+[
          \$]++g;s-j-P-;s^yyy^r^g;s:i:H:;s!X!!g;s|Z|n|;s*Q*J*;s{q}{s}g;s(f)(A);sys
          tem(join('',Sub(split('',$i))),(join('',Sub(split('')))));"

          To the optimist, the glass is half full.
          To the pessimist, the glass is half empty.
          To the engineer, the glass is twice as big as it needs to be.

          Adrian "Okay, I won't top-post unless it's an emergency" Stovall



          Unsubscribing info is here: http://help.yahoo.com/help/us/groups/groups-32.html

          Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
        • b2174ml
          Can someone tell me how to run a cgi script from the command line? I know there is a way to pass in values, but I don t know what the syntax is. Thanks Mike
          Message 4 of 8 , May 20, 2004
            Can someone tell me how to run a cgi script from the command line? I
            know there is a way to pass in values, but I don't know what the
            syntax is.

            Thanks

            Mike
          • Frederiko dos Santos Costa
            ... You can try to use perl program.cgi?field_name=value&field_name2=value
            Message 5 of 8 , May 20, 2004
              b2174ml wrote:

              >Can someone tell me how to run a cgi script from the command line? I
              >know there is a way to pass in values, but I don't know what the
              >syntax is.
              >
              >Thanks
              >
              >Mike
              >
              >
              >
              >
              >Unsubscribing info is here: http://help.yahoo.com/help/us/groups/groups-32.html
              >Yahoo! Groups Links
              >
              >
              >
              >
              >
              >
              >
              >
              >
              You can try to use perl program.cgi?field_name=value&field_name2=value
            • merlyn@stonehenge.com
              ... Frederiko You can try to use perl program.cgi?field_name=value&field_name2=value Which will do absolutely no good. :( If you re using CGI.pm, it has a
              Message 6 of 8 , May 20, 2004
                >>>>> "Frederiko" == Frederiko dos Santos Costa <fredec@...> writes:

                Frederiko> You can try to use perl program.cgi?field_name=value&field_name2=value

                Which will do absolutely no good. :(

                If you're using CGI.pm, it has a command-line debugging mode where you
                can enter key=value for all your form parameters.

                If you're not using CGI.pm, WHY NOT?

                --
                Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
                <merlyn@...> <URL:http://www.stonehenge.com/merlyn/>
                Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
                See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!
              • Charles K. Clarkson
                ... As a Windows user I tend to shy from command line parameters. My editor makes it fairly easy, but I prefer to add the parameter values from the script when
                Message 7 of 8 , May 20, 2004
                  merlyn@... Mmerlyn@...> wrote:
                  :
                  : >>>>> "Frederiko" == Frederiko dos Santos Costa
                  : <fredec@...> writes:
                  :
                  : Frederiko> You can try to use perl
                  : program.cgi?field_name=value&field_name2=value
                  :
                  : Which will do absolutely no good. :(
                  :
                  : If you're using CGI.pm, it has a command-line debugging
                  : mode where you can enter key=value for all your form
                  : parameters.

                  As a Windows user I tend to shy from command line
                  parameters. My editor makes it fairly easy, but I prefer
                  to add the parameter values from the script when testing.
                  I also like to use CGI::Pretty during testing. HTML is
                  usually easier to follow and check that way.

                  Start the script from the command line and do
                  something like this to start your code.

                  #!/usr/bin/perl

                  # disable buffering
                  $|++;

                  use strict;
                  use warnings;

                  # Drop the ::Pretty for production code
                  use CGI::Pretty;
                  my $q = CGI::Pretty->new();

                  # Testing
                  $q->param( name => 'Charles K. Clarkson' );
                  $q->param( gender => 'male' );
                  $q->param( email =>
                  'cclarkson@...',
                  'charles@...' );




                  HTH,

                  Charles K. Clarkson
                  --
                  Mobile Homes Specialist
                  254 968-8328
                Your message has been successfully submitted and would be delivered to recipients shortly.