Redirection using location 
Author Message
 Redirection using location

Does anyone know if Sambar 4.1 supports redirection.  I can't get this to
run after trying many, many things and I thought that maybe that might be
the problem.  There may be a problem with my script but I can't find it.

TIA,

Penn White

### test11.pl ###
#!c:\sambar41\perl\Perl.exe

&parse_form;

if ($FORM{'email'} ne "") {
    &openfile;
    exit;

Quote:
} else {
    &login;
}

sub login {
    print "Content-type: text/html\n\n";
    print qq~
        <html>
        <head><title>Test 1</title></head>
        <body>
        <form method=post action=\"/cgi-bin/test11.pl\">
        Please enter your email address:
        <input type=text NAME=email size=40 value="">
        <input type=submit value="Move on">
        </form>
        </body></html>
    ~;

Quote:
}

sub parse_form {
    if ($ENV{'REQUEST_METHOD'} eq 'POST') {
        read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});


            ($name, $value) = split(/=/, $pair);
            $value =~ tr/+/ /;
            $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
            $value =~ s/<([^>]|\n)*>//g;
            $value =~ s/<//g;
            $value =~ s/>//g;
            $FORM{$name} = $value;
        }
    }

Quote:
}

sub open_file {
    if ($page =~ /http/gi || $page =~ /.pl/gi || $page =~ /.cgi/gi) {
      print "Location: /cgi-bin/test22.pl\n\n";
      exit;
    }
 exit;

Quote:
}

### test22.pl ###
#!c:\sambar41\perl\Perl.exe

&printpage;

sub printpage {
 print "Content-type: text/html\n\n";
 print qq~
        <html>
        <head><title>Test 2</title></head>
        <body  bgcolor=\"#008000\">
        <center>
        <h1>You've made it this far!</h1>
        </center>
        </body></html>
    ~;

Quote:
}



Thu, 21 Dec 2000 03:00:00 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. redirection using Location

2. redirection using Location: in Perl CGI script

3. Wierd redirection problem with Location:

4. redirection Location help

5. Wierd redirection problem with Location:

6. Location, Redirection

7. using 'system' and i/o redirection

8. How to get picture file in web which involve redirection using LWP

9. print Location and print "Location

10. Why is var using same memory location

11. Please help - using a target with the Location cmd

12. Using print "Location:..." with frames

 

 
Powered by phpBB® Forum Software