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.
<?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;
}
}
?>
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.
Do you have Skype? or could you please register on my Hotel and see if it works for you please?What am I suppose to check in .htaccess?
Holy shit, learn to indent. I'm not even gonna read that.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.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
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?
bruh use HTTP_CF_CONNECTING_IP instead of REMOTE_ADDR when there's a proxy attached, that is what causes the error.
Sly is using BrainCMS you fucking retardUse https:// not http://
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...
Sly is using BrainCMS you fucking retard
Sent from my SM-G928F using Tapatalk
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.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
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;
}
<?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;
}
}
?>