in reply to Re: print and redirect
in thread print and redirect

Ive realised where ive gone wrong, but its given me another problem.

I am redirecting after i am creating a cookie. Since you can only write to a cookie once, does anyone know how i can write to a cookie and then immediately afterwards redirect to another page?

Costas

Replies are listed 'Best First'.
Re: Re: Re: print and redirect
by astanley (Beadle) on Apr 10, 2001 at 18:37 UTC
    When I want to redirect a user I use the <meta> tag http-equiv=refresh - it's never given me any trouble. I would have your script write your cookie function and when it returns send the browser one of these:
    <meta http-equiv="refresh" content="0;url=http://redirect.url.here?anycgi=options&here=too">

    -Adam Stanley
    Nethosters, Inc.
      This works fine,

      However is it better coding practise for me to write the following?

      <html> <head> <meta http-equiv="refresh" content="0;url=http://redirect.url.here?any cgi=options&here=too"> </head> <body></body> </html>

      rather than just the meta refresh line

Re: Re: Re: print and redirect
by suaveant (Parson) on Apr 10, 2001 at 19:32 UTC
    I don't think you can write a cookie in a redirect, I've tried before... you have to use a http-equiv refresh
                    - Ant
      I don't know how you tried it, but it works fine for me... See node below for working example :)

      Greetz
      Beatnik
      ... Quidquid perl dictum sit, altum viditur.