save cookie help

  • winracer
  • Newbie
  • Newbie
  • User avatar
  • Posts: 6

Post 3+ Months Ago

I want to make a different cookie for a number. like 5 and when a user returns to my site if new number is 10 read the number and show new on anything between 6 and 10.

I have started but can not jet the below code to write cookie to my computer I can see on screen. could someone tell me what i am doing wrong


Code: [ Select ]
$inFile323 = "$path/data/counter";

if(-e $inFile323)
{
open (INFILE323, $inFile323);
$name3 = <INFILE323>;
close (INFILE323);
}
else
{
$name3 ="0";
}



use CGI;
$query = new CGI;

$cookie = $query->cookie(-name=>'TEST_COOKIE',
-value=>"$name3",
-domain=>'www.website.com',
-expires=>'+1h',
-path=>'/');
$cookie1 = $name3;
print $query->header(-cookie=>$cookie);

print $query->start_html('My cookie-set.cgi program');
print $query->h3('The cookie has been set');

print "value=$value; path=$path; $cookie1 ;doman=$domain; expires=$expire\n\n";
print $query->end_html;
  1. $inFile323 = "$path/data/counter";
  2. if(-e $inFile323)
  3. {
  4. open (INFILE323, $inFile323);
  5. $name3 = <INFILE323>;
  6. close (INFILE323);
  7. }
  8. else
  9. {
  10. $name3 ="0";
  11. }
  12. use CGI;
  13. $query = new CGI;
  14. $cookie = $query->cookie(-name=>'TEST_COOKIE',
  15. -value=>"$name3",
  16. -domain=>'www.website.com',
  17. -expires=>'+1h',
  18. -path=>'/');
  19. $cookie1 = $name3;
  20. print $query->header(-cookie=>$cookie);
  21. print $query->start_html('My cookie-set.cgi program');
  22. print $query->h3('The cookie has been set');
  23. print "value=$value; path=$path; $cookie1 ;doman=$domain; expires=$expire\n\n";
  24. print $query->end_html;
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

Post Information

  • Total Posts in this topic: 1 post
  • Users browsing this forum: No registered users and 161 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.