open(DAT, "$formdata{user}.pl"[smilestopper]);
$rawdata=<DAT>;
close(DAT);
@login = split(/~/, $rawdata);
if($formdata{task} eq ""[smilestopper])
{
print "<html><head><title>Please Log In:</title></head><body bgcolor=#000000 text=#ffffff><form method=post action=test_Copy_1.pl?task=submit>";
print "User: <input type=text name=user><br>Pass: <input type=password name=pass>";
print "<input type=submit value=Submit></form>";
-----
(That's just an excerpt of it, by the way)
The subroutine that is being linked to on Line 5
%formdata = getFormData();
Takes the two input fields, named user and pass, and sticks them into two scalars (I'm skipping the hash step, that oughta be obvious), $formdata{user} and $formdata{pass}.
Now, as you can see above, $formdata{user} is used to open up a data file, of which it's contents are two words seperated by a ~. Those words are the username and password, respectively. These two words (split at the ~) get stuck into the array @login, so that's what those are. They become the scalars $login[0] and $login[1], if that needs to be said. :p
Now, my question is, is there a way to take these values ($login[0], $login[1]) and set them into the cookie which I'm trying to do in Line 2? That as it is just sets blanks (aka, nothing).
Any help would be appreciated, and that was probably confusing, so if I need to clarify anything, let me know.
Thank you!
[wp.netscape.com ] and [search.cpan.org ]
The syntax to set a cookie are as follows:
Set-Cookie: NAME=VALUE; expires=DATE; path=PATH; domain=DOMAIN_NAME; secure
Thus you need to set a name=value pair which you did not do in your code.
Andreas