This is a multi-part message in MIME format.
------=_NextPart_000_0055_01BF1162.EE016800
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Hello,
I'm quite a newbie in CGI , although I have already made some =
adjustments in pre-scripted CGI PERL routines.
For the last week, I've been trying to set a ridiculously simple cookie =
without success.
I hope you may give this poor soul a clue to make it as simple as =
possible, for an immediate result.
=20
Here is what I need and what I have been doing by now - for what there =
could be a better choice, for sure:
=20
My server is APACHE running UNIX and PERL 5.005=20
=20
1 . A banner somewhere must call a page ( www.mysite.com/index.htm , =
passing to it it's origin (e.g. site ''aaa" ) =20
=20
(I tried to accomplish this by means of a link to the index that had a =
SSI calling the perl routine that would issue the cookie setting - like =
this href=3D www.mysite.com/index.shtml?aaa .=20
The SSI in this case :
<!--#exec cgi=3D"/usr/www/mysite/cgi/origem.pl"-->
=20
2. The origem.pl routine issues a cookie setting for the value obtained =
through QUERY_STRING.
=20
I used the following coding for 'origem.pl' :
#!/usr/local/bin/perl
local($name, $expDate, $path, $domain ) =3D @_;
$name =3D "ORIGEM";
$expDate =3D " ";
$domain =3D ".apego.com.br";
$path =3D "/";=20
my ($value) =3D $ENV{'QUERY_STRING'};
#- Set Cookie =
-----------------------------------------------------------------#
print "Set-Cookie: ";
print ($name, "=3D", $value, "; expires=3D", $expDate,
"; path=3D", $path, "; domain=3D", $domain, "\n");
#------------------------------------------------------------------------=
------#
There's a <CR> after each line. I'm chmodeing 775 the file and compiling =
it (perl origem.pl) with no syntax errors.
But it's returning an error message before printing the page contents:
[an error occurred while processing this directive]=20
3. Another page will be posting a form that will call the formmail =
module. There, a check must take place so a message is printed in the =
E-mail with the form results.
Inside Matt's formmail I inserted some lines to check the cookie and =
print a message depending on the result.
coding is:
$mensagem1 =3D "----------- CONTACT COMING FROM XXX ";
$mensagem2 =3D "----------- CONTACT COMING FROM AAA";
$me2 =3D "-----" ;
$mens =3D " ";
...
...
# Check Cookie - origem
my ($biscuit) =3D $ENV{'HTTP_COOKIE'};
$mens =3D $me2;
if ($biscuit eq 'xxx') {$mens =3D $mensagem1;}
if ($biscuit eq 'aaa') {$mens =3D $mensagem2;}
...
...
print "\n$mens<br>";
print MAIL "-" x 75 . "\n\n";
It doesn't return any error, just a blank field, which suggests that the =
cookie hasn't been set .
A question: Is there any way to perform a testing for these modules =
under telnet ? How should I provide the parameter? (the server uses =
FreeBSD 2.2.8).
There must be surely some dumb error I can't see...
I will understand if you can't help me , but will be eternally thankful =
if you give me a clue.
Thanks in advance,
Gabriella Cipollini Aquinaga
pixelbr@ruralsp.com.br
------=_NextPart_000_0055_01BF1162.EE016800
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD W3 HTML//EN">
#!/usr/local/bin/perl
local($name, $expDate, $path, $domain ) =3D=20
@_;
$name =3D "ORIGEM";
$expDate =3D " =
";
$domain =3D=20
".apego.com.br";
$path =3D "/";
my ($value) =
=3D=20
$ENV{'QUERY_STRING'};
#- Set Cookie=20
-----------------------------------------------------------------#
pri=
nt=20
"Set-Cookie: ";
print ($name, "=3D", $value, =
";=20
expires=3D", $expDate,
"; path=3D", $path, "; =
domain=3D",=20
$domain,=20
"\n");
#----------------------------------------------------=
--------------------------#
$mensagem1 =3D "----------- CONTACT COMING FROM XXX =
";
$mensagem2=20
=3D "----------- CONTACT COMING FROM AAA";
$me2 =3D =
"-----"=20
;
$mens =3D " ";
# Check Cookie - origem
my ($biscuit) =3D =
$ENV{'HTTP_COOKIE'};
$mens =3D=20
$me2;
if ($biscuit eq 'xxx') {$mens =3D $mensagem1;}
if ($biscuit =
eq 'aaa')=20
{$mens =3D $mensagem2;}
print "\n$mens<br>";
print MAIL "-" x 75 =
.=20
"\n\n";