findretro's force vote help

Colbat

Ninja
Apr 10, 2013
82
8
Yo
I can't get the forcevote to work I've done everything right but still struggling with this:
Code:
<?php

require_once 'findretros_config.php';
require_once 'findretros.php';

$FindRetros = new FindRetros();

if($FindRetros->hasClientVoted()) {

    echo 'You have voted!';

}else{

    // echo 'You have yet to vote!';

    $FindRetros->redirectClientToVote();

}
were do I add this to I know iam suppose to add it to like client.php but were like in the very top or the very bottom because I tried the top and the client page didn't even load up after that.
 

RastaLulz

fight teh power
Staff member
May 3, 2010
3,934
3,932
You'd want to that code on the top of your "client.php" file, and make sure "findretros_config.php" and "findretros.php" are in the same folder. You can alternatively put them in a different folder, but you'd have to change the path.
 

Brad

Well-Known Member
Jun 5, 2012
2,320
993
Code:
<?php

require_once 'findretros_config.php';
require_once 'findretros.php';

$FindRetros = new FindRetros();

if($FindRetros->hasClientVoted()) {

    echo 'You have voted!';

}else{

    // echo 'You have yet to vote!';

    $FindRetros->redirectClientToVote();

}

?>

here use this you forgot ?>
 

RastaLulz

fight teh power
Staff member
May 3, 2010
3,934
3,932
Code:
<?php

require_once 'findretros_config.php';
require_once 'findretros.php';

$FindRetros = new FindRetros();

if($FindRetros->hasClientVoted()) {

    echo 'You have voted!';

}else{

    // echo 'You have yet to vote!';

    $FindRetros->redirectClientToVote();

}

?>

here use this you forgot ?>
No, you don't need to close PHP tags unless there's something below it like HTML, among other things.
 

JayC

Always Learning
Aug 8, 2013
5,505
1,401
Why are you echoing "You have already voted" you should just run the code inside that if statement... or run a if statement that just checks if they haven't voted no reason to check if they have.. Just like on a normal page like me it just runs to check if you're banned...
 

Brad

Well-Known Member
Jun 5, 2012
2,320
993
Why are you echoing you have already voted, that ends the if statement right there, you should just return. If you don't return its not going to run the rest of the code... or put your code inside that if statement but i doubt that will work..
It's a Vote Validator, it checks for the code & if you have it echos it, if hes having it on client.php Why would he have it redirect? it will just keep reloading.
 

Users who are viewing this thread

Top