Sorry to bombard so much code here... Basically, I am really confused as to whether its the cookie problem or the post problem? will I need to use GET instead? It seems that after the gallery link page it loses the variables storing the target for the page causing the return of the blank page. Can anyone help??? Thanks for any help you can give me.Reading in browser cookie script > sub getcookies{ $cookies = $ENV{'HTTP_COOKIE'}; @allcookies = split(/;\s*/,$cookies); foreach $i (@allcookies){ ($name,$value) = split(/\s*=\s*/,$i); $cookie{$name}=$value; } } PAge to read target URL INTO PAGE > sub gethtml { open (DATA,"text file DB location"); @DB=<DATA>; close (DATA); foreach $rec (@DB){ chomp($rec); ($token,$file)=split(/\t/,$rec); if ($input{'target'} eq $token) { $url = $file; } } open (HTML, "$url"); @PAGE=<HTML>; close (HTML); } Read in user data and check for valid username/password pair >>>>> sub idcheck { open (DATA,"<$DATABASE"); @DB=<DATA>; close (DATA); $valid = 0; foreach $rec (@DB){ chomp($rec); ($username,$password,$name,$email,$degree)=split(/\t/,$rec); $username = uc $username; $input{'user'} = uc $input{'user'}; if (($input{'user'} eq $username) && ($input{'pass'} eq $pass +word)) { $valid = 1; if ($input{'user'} eq "0") { $valid = 0; } } } return $valid; } >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> PArsing the form data >>>>> sub parseform { read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'}); $buffer =~ tr/+/ /; @pairs = split(/&/, $buffer); foreach $pair (@pairs) { ($name, $value) = split(/=/, $pair); $name =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg +; $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/e +g; $FORM{$name} = $value; } return %FORM; } if (&idcheck) { &gethtml; print "Content-type:text/html\n"; print "Set-Cookie: User=OK; domain=domain name; \n\n"; print @PAGE; exit; } else { &getcookies; if ($cookie{'User'} eq "OK") { &gethtml; print "Content-type: text/html\n\n"; print @PAGE; exit; }
In reply to Cookie Problem by lovely
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |