CGI.pm VS. The World! 
Author Message
 CGI.pm VS. The World!

I would like a script I am writing to run on every browser (even old
lynx and mosaic). So what would be the 'safest' way to redirect????

******Method A:*****

#!/usr/bin/perl
use CGI;

print $query->redirect(' http://www.*-*-*.com/ ')

*****Method B:******

#!/usr/bin/perl

print "Location: http://www.*-*-*.com/ \n\n";

-----------------------------------------------------------
Michael S. Brito, Jr., Web Developer
Newfangled Graphics Co. Inc.

#!/bin/perl -sp0777i<X+d*lMLa^*lN%0]dsXx++lMlN/dsM0<j]dsj
$/=unpack('H*',$_);$_=`echo 16dio\U$k"SK$/SM$n\EsN0p[lN*1
lK[d2%Sa2/d0$^Ixp"|dc`;s/\W//g;$_=(#####censored######)
-----------------------------------------------------------



Sat, 09 Dec 2000 03:00:00 GMT  
 CGI.pm VS. The World!

These are identical, as far as your browser is concerned. CGI.pm's
'print query->redirect() function really just prints out the complete
fully-HTTP-compliant Location:  HTTP header, as in your method B.

Anyone feel free to correct me if I'm wrong.

Matt Johnson


Quote:
> I would like a script I am writing to run on every browser (even old
> lynx and mosaic). So what would be the 'safest' way to redirect????

> ******Method A:*****

> #!/usr/bin/perl
> use CGI;

> print $query->redirect('http://www.domain.com/up/yours.html')

> *****Method B:******

> #!/usr/bin/perl

> print "Location:http://www.domain.com/up/yours.html\n\n";

> -----------------------------------------------------------
> Michael S. Brito, Jr., Web Developer
> Newfangled Graphics Co. Inc.

> #!/bin/perl -sp0777i<X+d*lMLa^*lN%0]dsXx++lMlN/dsM0<j]dsj
> $/=unpack('H*',$_);$_=`echo 16dio\U$k"SK$/SM$n\EsN0p[lN*1
> lK[d2%Sa2/d0$^Ixp"|dc`;s/\W//g;$_=(#####censored######)
> -----------------------------------------------------------



Mon, 11 Dec 2000 03:00:00 GMT  
 CGI.pm VS. The World!



+ These are identical, as far as your browser is concerned. CGI.pm's
+ 'print query->redirect() function really just prints out the complete
+ fully-HTTP-compliant Location:  HTTP header, as in your method B.

Well, it does a bit more than:

+ > print "Location:http://www.domain.com/up/yours.html\n\n";

% tester.pl
(offline mode: enter name=value pairs on standard input)
Status: 302 Found
Uri: http://www.bogus.com/bogus/web/site/
Location: http://www.bogus.com/bogus/web/site/
Content-type: text/html

Contents of tester.pl:

use CGI;
$query=new CGI;
$filename="http://www.bogus.com/bogus/web/site/";
print $query->redirect($filename);

James - I love offline mode in CGI.pm...



Mon, 11 Dec 2000 03:00:00 GMT  
 CGI.pm VS. The World!


Matt> These are identical, as far as your browser is
Matt> concerned. CGI.pm's 'print query->redirect() function
Matt> really just prints out the complete
Matt> fully-HTTP-compliant Location: HTTP header, as in your
Matt> method B.

Not quite the same, as you can see from testing it in
off-line mode.

This follow-up brought to you by the words:

    abstraction
    encapsulation


Quote:
>> use CGI;

>> print $query->redirect('http://www.domain.com/up/yours.html')

What is `$query'?  Where is it `new'ed?

tony
--
Tony Curtis, Systems Manager, VCPC,      | Tel +43 1 310 93 96 - 12; Fax - 13
Liechtensteinstrasse 22, A-1090 Wien, AT | http://www.vcpc.univie.ac.at/

"You see? You see? Your stupid minds! Stupid! Stupid!" ~ Eros, Plan9 fOS.



Tue, 12 Dec 2000 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. CGI.pm vs. Base.pm

2. CGI-modules vs. CGI.pm

3. cgi-lib.pl vs CGI.pm?

4. cgi-lib.pl vs CGI.pm

5. cgi.pm .vs. cgi-lib.pl

6. CGI.pm functions vs OO

7. vvp:CGI.pm printing vs executing statments?

8. CGI.pm: procedural vs. OO

9. CGI.pm and POST vs GET methods

10. CGI.pm vs. mac characters

11. socket accept() vs. CGI.pm accept()

12. Installation: Carp.pm vs. CGI::Carp

 

 
Powered by phpBB® Forum Software