print Location and print "Location 
Author Message
 print Location and print "Location

At the end of a registration script, I set a cookie and want the user go
to a certain URL using "print "Location...." ... but it doesn't work.
I read a posting saying we can't go to a location if there is a print
"Content-type: text/html\n" before is someone have a tip because in my
case
print "Location text/html\n" don't print an HTML page but a gentle cookie.

print "Content-type: text/html\n";
print "Set-cookie: .....\n\n";

print "Location: http://.....\n\n";
_____________________________________________________
___________                              ____________

_____________________________________________________

"In an open system we compete with our imagination"
          Nicholas Negroponte, BEING DIGITAL



Fri, 02 Oct 1998 03:00:00 GMT  
 print Location and print "Location
Hi.
Why do you print these two lines?

Quote:
> print "Content-type: text/html\n";
> print "Set-cookie: .....\n\n";

You should only print the location-row to force the client to load
another page.

Quote:
> print "Location: http://.....\n\n";

/Neiden
Quote:

> At the end of a registration script, I set a cookie and want the user go
> to a certain URL using "print "Location...." ... but it doesn't work.
> I read a posting saying we can't go to a location if there is a print
> "Content-type: text/html\n" before is someone have a tip because in my
> case
> print "Location text/html\n" don't print an HTML page but a gentle cookie.

> print "Content-type: text/html\n";
> print "Set-cookie: .....\n\n";

> print "Location: http://.....\n\n";
> _____________________________________________________
> ___________                              ____________

> _____________________________________________________

> "In an open system we compete with our imagination"
>           Nicholas Negroponte, BEING DIGITAL



Sat, 03 Oct 1998 03:00:00 GMT  
 print Location and print "Location


Quote:
> print "Content-type: text/html\n";
> print "Set-cookie: .....\n\n";
> print "Location: http://.....\n\n";

The problem here is that HTTP only looks at the header for instructions - and
the header ends on the first blank line. remove one of the \n's from the
Set-cookie line. You should only have a '\n\n' on the last header line.

Works for me.

Cheers,
        Markus

--
Markus Buchhorn,  Parallel Computing Research Facility   |  Ph: +61 6 2492930

Australian National University, Canberra 0200, Australia | Mobile: 017 970715



Fri, 09 Oct 1998 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. print "Location: http://..." avec param├Ętres

2. print "Location: $filename\n\n";

3. print "Location: my_html.html\n\n";

4. print "Location: my_html.html\n\n";

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

6. print "Location: erratic ???????????

7. print "Location: revised

8. print "Location:

9. Problem with print" Location:

10. print "Location: -with target?

11. redirect location prints to screen

12. simple print location and content-type?

 

 
Powered by phpBB® Forum Software