in reply to Re: Re: Redirecting Problem
in thread Redirecting Problem

Thanks, I'm so glad I am not the only one that's been through this! And thanks for letting me know it IS my header, which still sorta confuses me...does that mean I will no longer need print $query->header; , I just replace it with the redirect script you have?

I installed it by deleting my other header print, but I ran into another problem. I am doing:
my $url; $url = 'www.site.com';
But when I try $query->redirect('$url') ; it's trying to show me you can't use a scalar here. Is this true?

Thanks so much!

Replies are listed 'Best First'.
Re: Re: Re: Re: Redirecting Problem
by oylee (Pilgrim) on Aug 08, 2002 at 19:00 UTC
    Try using double quotes " instead of ' or don't use quotes at all. I.e.,
    print $query->redirect($url); or print $query->redirect("$url"); # unnecessary double quotes

    Single quotes don't interpolate.
      Nope :( I tried single quotes, double quotes, and no quotes. All result in no page loading, sever email spamming, etc. urgh
Re: Re: Re: Re: Redirecting Problem
by DigitalKitty (Parson) on Aug 08, 2002 at 23:43 UTC
    Hi VFT,

    Single quotes ( '' ) don't allow variable interpolation where as double quotes ( "" ) do. Here is an example:
    #!c:\perl\perl.exe -wT use strict; use CGI; use CGI::Carp qw( fatalsToBrowser ); my $q = new CGI; my $url = "http://www.google.com"; print $q->redirect("$url"); print $q->header();

    Hope this helps,

    -Katie.
    A reply falls below the community's threshold of quality. You may see it by logging in.
Re: Re: Re: Re: Redirecting Problem
by Abstraction (Friar) on Aug 08, 2002 at 17:45 UTC
    a $query->redirect($url) should do the trick.
      in theory it should work, but it won't...
Re: Re: Re: Re: Redirecting Problem
by fglock (Vicar) on Aug 08, 2002 at 18:44 UTC

    Do you mean  $query->redirect($url) maybe?

      I actually tried it without quotes and it didn't make any difference..
A reply falls below the community's threshold of quality. You may see it by logging in.