Thanks Carl, it's finally working! Just seems like I couldn't find your way of defining the cookie variable off the web, esp from wiley or stein, i tried using their method but I just couldn't retrieve it.
Million Thanks! ----- Original Message ----- From: "Carl Franks" <[EMAIL PROTECTED]> To: "ChaoZ InferNo" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Wednesday, April 10, 2002 9:20 PM Subject: Re: Problem in retrieving param from cookie > Have you tried the following? > > my %answers = $q->cookie("my_cookie"); > print "$answers{q1} $answers{q2} $answers{q3}"; #etc... > > Carl > > > Let's say if I create a cookie with $questions and $answers value pairs > > where $questions consists of q1, q2, q3, q4, q5, while $answers consists of > > a1, a2, a3, a4, a5. > > I have no problem in printing out every value of a cookie by using > > > > my %answers = $q->cookie("my_cookie"); > > if(%answers) > > { > > foreach $name(%survey_ans) > > {print "$name :\n"; > > } > > > > results : q1 : a1 :q1 :a2 :q3 :a3 :q4 :a4 :q5 :a5. > > > > but I am facing a problem on retrieving a specified attribute in a cookie. > > > > my $value_1 = $q->param(-name=>'q1', -value=>[$q->cookie('my_cookie')]); > > my $value_2 = $q->param(-name=>'q2', -value=>[$q->cookie('my_cookie')]); > > my $value_3 = $q->param(-name=>'q3', -value=>[$q->cookie('my_cookie')]); > > my $value_4 = $q->param(-name=>'q4', -value=>[$q->cookie('my_cookie')]); > > my $value_5 = $q->param(-name=>'q5', -value=>[$q->cookie('my_cookie')]); > > > > print "$value_1, $value_2" # till $value_5 > > > > results : q1 > > correct results : a1 a2 a3 a4 a5 > > > > The query is incorrect. Is my cookie corrupted? but I managed to print > > everything out. Or is my $value_x defined wrongly? > > -- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]