If you are not registered or logged in, you may still use these forums but with limited features. Show recent topics
  [Search] Search   [Hottest Topics] Hottest Topics   [Members]  Member Listing   [FAQ]  FAQ 
[Register] Register / 
[Login] Login 
Cookies and Advanced Poll 2.0  XML
Forum Index » Support Forum
Author Message
lisajill
Beginner

Joined: 18/08/2003 17:56:21
Messages: 5
Location: White Plains
Offline

I got this working easily, however it seems, after a few hours that it'll let me enter the poll again. My IP's not changing and I'm not clearing cookies.

I figured it's because I didn't have this bit of code (which isn't in the help section, only demo's?)

<?php
/* Include this before your html code */
include "/poll/poll_cookie.php";
?>

I tried putting this in between the <head> and </head> tags (figuring that's what was meant by 'before your html code') and I get this error:

Warning main (/poll/poll_cookie.php): failed to open stream: No such file or directory in /u/web/lisaji/index.php on line 7

Warning main{}: Failed opening '/poll/poll_cookie.php' for inclusion (include_path=:/usr/local/lib/php4/lib/php' in /u/web/lisaji/index.php on line 7

I've tried with several different paths, including /u/web/lisaji/poll/poll_cookie.php (where it's at), ./poll_cookie.php and /poll/poll_cookie.php'

The file is definitely there and I'm positive about the path, am I missing something here?

Thank you =)

Lisa
http://www.lisa-jill.com
[WWW] [Yahoo!] aim icon [MSN] [ICQ]
lisajill
Beginner

Joined: 18/08/2003 17:56:21
Messages: 5
Location: White Plains
Offline

Please ignore, I chmodded it to 777 and it worked /blush

Lisa
http://www.lisa-jill.com
[WWW] [Yahoo!] aim icon [MSN] [ICQ]
Auron
Expert
[Avatar]

Joined: 23/06/2003 22:02:17
Messages: 1053
Offline

The correct answer is that as in before html code it means like this...



Also you do not need to chmod the page the poll is included in.

To change how long the cookies will last open poll_cookie.php and the value is right at the top, and is in hours. If you use the IP table as well its best to set the locking timeout for the same amount of time as the cookie. So they expire at the same time.

Auron

Visit my site @ www.ragnaru.com
Adv. Poll Install Guide NOW BACK ONLINE! (And also rather out of date I would of thought)
[Email] [WWW]
Anonymous



Can you set it so that it never expires for that poll?

I don't want people voting again.. or do I need to choose some really long lasting value?

and befor eeven the html code? I'll fix that, thank you =)
lisajill
Beginner

Joined: 18/08/2003 17:56:21
Messages: 5
Location: White Plains
Offline

Woops that was me...

This is resetting in like 2-4 hours, not the 96 mentioned in the cookie file; i'm going to set it to lie 9999 and see if that helps... would rather forever (per poll) tho =)

Lisa
http://www.lisa-jill.com
[WWW] [Yahoo!] aim icon [MSN] [ICQ]
lisajill
Beginner

Joined: 18/08/2003 17:56:21
Messages: 5
Location: White Plains
Offline

Also since i added that call before the html when you answer a poll it reloads the page and says

Warning: Cannot modify header information - headers already sent by (output started at /u/web/lisaji/index.php:3 in /u/web/lisaji/poll/poll_cookie.php on line 21

twice...

how can i fix that?

thanks =)

Lisa
http://www.lisa-jill.com
[WWW] [Yahoo!] aim icon [MSN] [ICQ]
Auron
Expert
[Avatar]

Joined: 23/06/2003 22:02:17
Messages: 1053
Offline

You don't want the cookie to never expire otherwise people won't be able to vote at all on your site, I think. The thing is I'm not sure if the cookie has data on which poll it belongs to. For example someone can have a cookie that covers poll 1 but not poll 2. They would have to have a cookie specific to each poll. I think thats how it works. Its best to make it last for the same amount of time the poll will last. For example a poll that lasts a day make the cookie last 24 hours. But you could just make it like 1000 hours if the cookie is not specific to a particular which I think it is.

I'll have a look at the cookie code myself.

In answer to you problem above make sure you have no spaces before the opening <?php tag and/or after the closing ?> and opening <html> tags.

Auron

Visit my site @ www.ragnaru.com
Adv. Poll Install Guide NOW BACK ONLINE! (And also rather out of date I would of thought)
[Email] [WWW]
lisajill
Beginner

Joined: 18/08/2003 17:56:21
Messages: 5
Location: White Plains
Offline

Thanks Auron =)

The problem is that I have no idea how long I'll leave the poll; depends when I uh, get bored - it's a personal site so =)

Can i set it to a large number, then when I want to change it set it to like, 1 hour and have it expire then change it so people can vote?

If that makes sense?

If not I may need to find different software, but I really love this package =)

Lisa
http://www.lisa-jill.com
[WWW] [Yahoo!] aim icon [MSN] [ICQ]
Auron
Expert
[Avatar]

Joined: 23/06/2003 22:02:17
Messages: 1053
Offline

Once the cookie has been set it can't be changed until it expires, that means the script won't write a new expiry time to it since it stops them from voting and as they can't vote the script won't create them a new one. The best thing to is if you want a poll to last three days do this...

Day one set the cookie (in poll_cookie.php) for 96 hours,
day two set the cookie for 48 hours,
day three set the cookie for 24 hours,
day four everyones cookies expire and you need to change the poll.

Thats all I can suggest really, unless you use IP logging and then when you wish to change the poll you clear the log file. But if the cookie is specific to a poll it won't matter how long you set it for because you can just create a new poll that has a different poll id.

Auron

Visit my site @ www.ragnaru.com
Adv. Poll Install Guide NOW BACK ONLINE! (And also rather out of date I would of thought)
[Email] [WWW]
 
Forum Index » Support Forum
Go to:   
Based on the open source JForum