Link to home
Start Free TrialLog in
Avatar of rrivers
rrivers

asked on

Cookies

I am trying to set up a PERL script that prints a web page to the screen as well as setting a cookie up on the client. When I try to do this with the following code:

print "Set-Cookie: id=$id\;";
print "Content-type:text/html\n\n";
print<<web;
 <HTML>
<head><title></head></title>
<body bgcolor=white>
  <CENTER>
 <table width=450>
<th bgcolor=navy colspan=4><center><font color=yellow>The Following was added to
 your shopping basket:</font></center></th>
<tr bgcolor=yellow>
    <td>Quantity</td>
And so on....

It ends up setting the cookie, but then prints all the HTML code as plain text. Anyone know why this is happening and how to prevent it?

Thanks
Avatar of martinag
martinag

Does this work for you?
print "Set-Cookie: id=$id\n";

Martin
Avatar of rrivers

ASKER

That $##%#$ did it! I had no idea those stupid little new line characters were so improtant!
The points are yours..
ASKER CERTIFIED SOLUTION
Avatar of martinag
martinag

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial