FindRetros Vote Problem

Status
Not open for further replies.

Sly

I don't break the rules I bend them.
Oct 28, 2016
246
38
Some users have been getting this error whent hey try to vote and some arent,
What is the issue at hand?
I am using sucuri.net cloudProxy does this contridict to findretros?

What
BACE0_B6_B1_F70805371_F67_C899_EB274972120652381_BDD5_C.png
 
Last edited:

yoyok

Member
Apr 24, 2013
197
24
It redirect the user many times. If someone set the vote at /index, it will first re direct to index.php then re direct > vote page > back to index. That's way to much. I can't see your php code, so don't know where it exactly going wrong.
 

Sly

I don't break the rules I bend them.
Oct 28, 2016
246
38
It's redirect the user many times. If someone set the vote at /index, it will first re direct to index.php then re direct > vote page > back to index. That's way to much. I can't see your php code, so don't know where is exactly going wrong.

Here you go..

PHP:
<?php
if(isset($_GET['voted'])) {
}
else {
$userip = "{$_SERVER['REMOTE_ADDR']}";
$current_url = substr($_SERVER["SCRIPT_NAME"],strrpos($_SERVER["SCRIPT_NAME"],"/")+1);
$url = 'http://votingapi.com/validate.php?user=robbo&ip=' . $userip;
$context = stream_context_create(array('http' => array('timeout' => 1)));
$data = @file_get_contents($url, 1, $context);
if(!$data || !is_numeric($data)) {
return "Error";
}
else if ($data == 1 || $data == 2) {
}
else {
header ("Location: http://votingapi.com/vote.php?username=robbo&api=http:!!robbo.pw!index?novote");
exit;
}
}
?>
 
I'm also using Sucuri.net cloudProxy
 

yoyok

Member
Apr 24, 2013
197
24
As you already mentioned that some users (not all) have this problem, probably it's the .htaccess. It can be also Sucuri, because they have a redirect 'anti DDos check' .

Make sure there is no issue with your .htaccess and don't forget to delete your cookies when you test it again.
 

Sly

I don't break the rules I bend them.
Oct 28, 2016
246
38
As you already mentioned that some users (not all) have this problem, probably it's the .htaccess. It can be also Sucuri, because they have a redirect 'anti DDos check' .

Make sure there is no issue with your .htaccess and don't forget to delete your cookies when you test it again.

What am I suppose to check in .htaccess?
 
What am I suppose to check in .htaccess?
Do you have Skype? or could you please register on my Hotel and see if it works for you please?
 

BIOS

ಠ‿ಠ
Apr 25, 2012
906
247
Here you go..

PHP:
<?php
if(isset($_GET['voted'])) {
}
else {
$userip = "{$_SERVER['REMOTE_ADDR']}";
$current_url = substr($_SERVER["SCRIPT_NAME"],strrpos($_SERVER["SCRIPT_NAME"],"/")+1);
$url = 'http://votingapi.com/validate.php?user=robbo&ip=' . $userip;
$context = stream_context_create(array('http' => array('timeout' => 1)));
$data = @file_get_contents($url, 1, $context);
if(!$data || !is_numeric($data)) {
return "Error";
}
else if ($data == 1 || $data == 2) {
}
else {
header ("Location: http://votingapi.com/vote.php?username=robbo&api=http:!!robbo.pw!index?novote");
exit;
}
}
?>
 
I'm also using Sucuri.net cloudProxy
Holy shit, learn to indent. I'm not even gonna read that.

This is a very common issue related to voting/ISP's, you can find so many posts about it if you just .
 

MayoMayn

BestDev
Oct 18, 2016
1,423
683
Here you go..

PHP:
<?php
if(isset($_GET['voted'])) {
}
else {
$userip = "{$_SERVER['REMOTE_ADDR']}";
$current_url = substr($_SERVER["SCRIPT_NAME"],strrpos($_SERVER["SCRIPT_NAME"],"/")+1);
$url = 'http://votingapi.com/validate.php?user=robbo&ip=' . $userip;
$context = stream_context_create(array('http' => array('timeout' => 1)));
$data = @file_get_contents($url, 1, $context);
if(!$data || !is_numeric($data)) {
return "Error";
}
else if ($data == 1 || $data == 2) {
}
else {
header ("Location: http://votingapi.com/vote.php?username=robbo&api=http:!!robbo.pw!index?novote");
exit;
}
}
?>
 
I'm also using Sucuri.net cloudProxy
bruh use HTTP_CF_CONNECTING_IP instead of REMOTE_ADDR when there's a proxy attached, that is what causes the error.

that is so shit coded compared to the default now by FindRetros

that is so shit code compared to the default by FindRetros

Sent from my SM-G928F using Tapatalk
 
Last edited by a moderator:

Core

Member
Nov 10, 2016
356
138
What am I suppose to check in .htaccess?
 

Do you have Skype? or could you please register on my Hotel and see if it works for you please?

Use https:// not http://

bruh use HTTP_CF_CONNECTING_IP instead of REMOTE_ADDR when there's a proxy attached, that is what causes the error.

He's using RevCMS (or at least a cms based on it's framework)... which sets REMOTE_ADDR to HTTP_CF_CONNECTING_IP if it's set...
 

MayoMayn

BestDev
Oct 18, 2016
1,423
683
Why are so salty lmao? wait I know 'cause you don't know how to research things...
He could just add it to his global.php xD then he's good to go
The point is that you argue without having just the minimal facts right first. 2) You didn't even know which CMS he's using. 3) You didn't add any code or any way to fix the error 4) It is a bad way because it can be used as an IP exploit instead of using HTTP_X_FORWARDED(_FOR). Sorry my bad.

EDIT:
Well written article by CloudFlare:


Second exception: X-Forwarded-For

X-Forwarded-For is a well-established HTTP header used by proxies, including CloudFlare, to pass along other IP addresses in the request. This is often the same as CF-Connecting-IP, but there may be multiple layers of proxies in a request path.

Sent from my SM-G928F using Tapatalk
 
Anyway, here is your solution that is correctly coded Sly:
now defines the Forwarded: header, which is intended to replace X-Forwarded-*. If you care about standards, i would recommend using that instead.


PHP:
         public function getIP() {
                $ip = $_SERVER['REMOTE_ADDR'];
                if(isset($_SERVER['HTTP_FORWARDED'])) {
                    $ip = $_SERVER['HTTP_FORWARDED'];
                } elseif(isset($_SERVER['HTTP_X_FORWARDED'])){
                    $ip = $_SERVER['HTTP_X_FORWARDED'];
                }
                return $ip;
        }
Anyway, I'd recommend using FindRetros classes instead of the script you have now.
 
Last edited:

Sly

I don't break the rules I bend them.
Oct 28, 2016
246
38
OK ya'll solutions didn't work. Figured it out, did after vote link page to robbo.pw/client?novote and included it in the client.php it worked
 
PHP:
<?php
if(isset($_GET['voted'])) {
}
else {
$userip = "{$_SERVER['HTTP_CF_CONNECTING_IP']}";
$current_url = substr($_SERVER["SCRIPT_NAME"],strrpos($_SERVER["SCRIPT_NAME"],"/")+1);
$url = 'https://votingapi.com/validate.php?user=robbo&ip=' . $userip;
$context = stream_context_create(array('https' => array('timeout' => 1)));
$data = @file_get_contents($url, 1, $context);
if(!$data || !is_numeric($data)) {
return "Error";
}
else if ($data == 1 || $data == 2) {
}
else {
header ("Location: https://votingapi.com/vote.php?username=robbo&api=https:!!robbo.pw!index?novote");
exit;
}
}
?>
 
Status
Not open for further replies.

Users who are viewing this thread

Top