|
You last visited: Today at 12:12
Advertisement
VOTING SCRIPT PROBLEM
Discussion on VOTING SCRIPT PROBLEM within the Flyff Private Server forum part of the Flyff category.
11/01/2016, 04:53
|
#1
|
elite*gold: 0
Join Date: Dec 2013
Posts: 245
Received Thanks: 28
|
VOTING SCRIPT PROBLEM
Votepoints won't add, can anyone help me?
Votingscript
<div id="page">
<center>
<?php
$ip = $_SERVER['REMOTE_ADDR'];
$votepoint = 3;
$time=date('d.m.Y H:i:s');
$voterIP = $_SERVER['REMOTE_ADDR']; // voter ip address
$time=date('Y.m.d H:i:s');
$pingUsername = $_SESSION['user']; // $pingUsername is a custom field you can use to track your players user name or id number.
if(!isset($_SESSION['user']))
{
echo "No se olvide de iniciar sesión!";
}
else
{
odbc_exec($mssql, 'USE [ACCOUNT_DBF]');
$vpuntos = odbc_exec($mssql, 'SELECT votepoints FROM [ACCOUNT_TBL] WHERE account=\''.mssql_escape_string($_SESSION['user']).'\'');
echo '<i>You have '.odbc_result($vpuntos, 'votepoints').' VPoint(s) </i><br /><br />';
echo 'You can vote 1 time every <b>12</b> hour(s).<br />';
echo 'Each time you vote, you earn 2 points for every vote.<br /><br />';
?>
<a href="http://www.gtop100.com/topsites/Flyff/sitedetails/asda-21179?vote=1&pingUsername=<?php echo''.$_SESSION['user'].''?>" target="_blank"><img src="images/vote.png" width="120" height="50" border="0" alt="Vota por Flyff"/></a>
<?php
}
}
?>
</center>
</div>
Pingback
<?php
$authorized = array("127.0.0.1"); // authorized ips to prevent exploitation
if(!in_array($_SERVER["REMOTE_ADDR"],$authorized))
exit;
$success = abs($_POST["Successful"]); // 1 for error, 0 for successful
$reason = $_POST["Reason"]; // log reason the vote failed
$pingUsername = $_POST["pingUsername"];
include('/Inc/config.inc.php');
if($success == 0)
{
odbc_exec($mssql, 'USE [ACCOUNT_DBF]');
odbc_exec($mssql, 'UPDATE [ACCOUNT_TBL] SET votepoints=votepoints+\'3\' WHERE account=\''.mssql_escape_string($pingUsername ).'\'');
odbc_exec($mssql, 'UPDATE [ACCOUNT_TBL] SET votepoints1=votepoints1+\'3\' WHERE account=\''.mssql_escape_string($pingUsername ).'\'');
odbc_exec($mssql, 'UPDATE [ACCOUNT_TBL] SET votepoints2=votepoints2+\'3\' WHERE account=\''.mssql_escape_string($pingUsername ).'\'');
}
?>
|
|
|
11/01/2016, 20:01
|
#2
|
elite*gold: 0
Join Date: Jan 2009
Posts: 1,741
Received Thanks: 1,674
|
Any errors shown in the PHP error log?
Replace the \'3\' with 3, so remove the escaped quote signs. votepoints - votepoints2 are for sure integers, but you are trying to add a string to a number. This might work in PHP somehow, but fails in a lot of languages, this includes SQL.
|
|
|
11/02/2016, 13:14
|
#3
|
elite*gold: 0
Join Date: Dec 2013
Posts: 245
Received Thanks: 28
|
Quote:
Originally Posted by xTwiLightx
Any errors shown in the PHP error log?
Replace the \'3\' with 3, so remove the escaped quote signs. votepoints - votepoints2 are for sure integers, but you are trying to add a string to a number. This might work in PHP somehow, but fails in a lot of languages, this includes SQL.
|
<?php
$authorized = array("127.0.0.1"); // authorized ips to prevent exploitation
if(!in_array($_SERVER["REMOTE_ADDR"],$authorized))
exit;
$success = abs($_POST["Successful"]); // 1 for error, 0 for successful
$reason = $_POST["Reason"]; // log reason the vote failed
$pingUsername = $_POST["pingUsername"];
include('/Inc/config.inc.php');
if($success == 0)
{
odbc_exec($mssql, 'USE [ACCOUNT_DBF]');
odbc_exec($mssql, 'UPDATE [ACCOUNT_TBL] SET votepoints=votepoints+3 WHERE account=\''.mssql_escape_string($pingUsername ).'\'');
odbc_exec($mssql, 'UPDATE [ACCOUNT_TBL] SET votepoints1=votepoints1+3 WHERE account=\''.mssql_escape_string($pingUsername ).'\'');
odbc_exec($mssql, 'UPDATE [ACCOUNT_TBL] SET votepoints2=votepoints2+3 WHERE account=\''.mssql_escape_string($pingUsername ).'\'');
}
?>
Still wont work
|
|
|
11/04/2016, 18:20
|
#4
|
elite*gold: 0
Join Date: Oct 2012
Posts: 948
Received Thanks: 157
|
Make an check to see if you got any errors.
Code:
if($success == 0)
{
odbc_exec($mssql, 'USE [ACCOUNT_DBF]');
odbc_exec($mssql, 'UPDATE [ACCOUNT_TBL] SET votepoints=votepoints+3 WHERE account=\''.mssql_escape_string($pingUsername ).'\'');
odbc_exec($mssql, 'UPDATE [ACCOUNT_TBL] SET votepoints1=votepoints1+3 WHERE account=\''.mssql_escape_string($pingUsername ).'\'');
odbc_exec($mssql, 'UPDATE [ACCOUNT_TBL] SET votepoints2=votepoints2+3 WHERE account=\''.mssql_escape_string($pingUsername ).'\'');
}
else
{
echo 'There was an error';
}
In that case if you see on you web. There was an error then you can ask your self why is $_POST['Successful'] giving me an error  .
|
|
|
11/04/2016, 19:49
|
#5
|
elite*gold: 0
Join Date: Jan 2009
Posts: 1,741
Received Thanks: 1,674
|
Quote:
Originally Posted by Cloud'
<?php
$authorized = array("127.0.0.1"); // authorized ips to prevent exploitation
if(!in_array($_SERVER["REMOTE_ADDR"],$authorized))
exit;
$success = abs($_POST["Successful"]); // 1 for error, 0 for successful
$reason = $_POST["Reason"]; // log reason the vote failed
$pingUsername = $_POST["pingUsername"];
include('/Inc/config.inc.php');
if($success == 0)
{
odbc_exec($mssql, 'USE [ACCOUNT_DBF]');
odbc_exec($mssql, 'UPDATE [ACCOUNT_TBL] SET votepoints=votepoints+3 WHERE account=\''.mssql_escape_string($pingUsername ).'\'');
odbc_exec($mssql, 'UPDATE [ACCOUNT_TBL] SET votepoints1=votepoints1+3 WHERE account=\''.mssql_escape_string($pingUsername ).'\'');
odbc_exec($mssql, 'UPDATE [ACCOUNT_TBL] SET votepoints2=votepoints2+3 WHERE account=\''.mssql_escape_string($pingUsername ).'\'');
}
?>
Still wont work
|
Then check your PHP error logs...
|
|
|
11/05/2016, 07:55
|
#6
|
elite*gold: 0
Join Date: Dec 2013
Posts: 245
Received Thanks: 28
|
[01-Nov-2016 00:37:28 Asia/Manila] PHP Warning: odbc_connect(): SQL error: [Microsoft][ODBC SQL Server Driver]Login timeout expired, SQL state S1T00 in SQLConnect in C:\Inetpub\vhosts\test-flyff.net\httpdocs\modules\vote.php on line 10
[01-Nov-2016 00:37:28 Asia/Manila] PHP Warning: odbc_exec() expects parameter 1 to be resource, boolean given in C:\Inetpub\vhosts\test-flyff.net\httpdocs\includes\xinc_functions.php on line 357
[01-Nov-2016 00:37:28 Asia/Manila] PHP Warning: odbc_exec() expects parameter 1 to be resource, boolean given in C:\Inetpub\vhosts\test-flyff.net\httpdocs\includes\xinc_functions.php on line 358
[01-Nov-2016 00:37:28 Asia/Manila] PHP Warning: odbc_result() expects parameter 1 to be resource, null given in C:\Inetpub\vhosts\test-flyff.net\httpdocs\includes\xinc_functions.php on line 359
[01-Nov-2016 00:37:28 Asia/Manila] PHP Warning: odbc_exec() expects parameter 1 to be resource, boolean given in C:\Inetpub\vhosts\test-flyff.net\httpdocs\modules\vote.php on line 92
[01-Nov-2016 00:37:28 Asia/Manila] PHP Warning: odbc_exec() expects parameter 1 to be resource, boolean given in C:\Inetpub\vhosts\test-flyff.net\httpdocs\modules\vote.php on line 93
[01-Nov-2016 00:37:28 Asia/Manila] PHP Warning: odbc_result() expects parameter 1 to be resource, null given in C:\Inetpub\vhosts\test-flyff.net\httpdocs\modules\vote.php on line 95
[31-Oct-2016 16:37:59 UTC] PHP Warning: odbc_connect(): SQL error: [Microsoft][ODBC SQL Server Driver]Login timeout expired,
This is my php error log.
|
|
|
 |
Similar Threads
|
DP For Voting Script
07/11/2016 - Shaiya PServer Development - 0 Replies
#Request to close, my brain wasnt working..
|
Voting Script!
07/06/2013 - Dekaron Private Server - 0 Replies
I am using a voting script, and I am having a small problem with it!
I have EVERYTHING set up correctly with it. The script is all changed up to fit my server and also the Mysql and Mssql connections are set up. This includes the db for the mysql part of the script. All votes are being imported into the mysql db and everything seems to be working fine. I myself have been using it to vote for my own server and to assure everything is fine with the script.
It seems that a few members are...
|
Voting Script
06/30/2012 - C/C++ - 1 Replies
Hallo liebe Gemeinde,
ich bin neu und brauche Eure Hilfe. Wir nehmen derzeit an einem Voting teilen und liegen derzeit abgeschlagen. Es wäre für uns enorm wichtig dieses Voting zu gewinnen. Mit 1 IP kann man alle 20 Minuten abstimmen oder Chaptca (phon.). Obwohl ich es schon mit einem IP-Changer versucht habe, was auch klappt, kommen wir nicht an die Ersten ran.
Nun die Frage: Kann jemand ein Script schreiben, mit dem es möglich ist das Voting, welches noch fünt Tage aktiv ist, doch noch...
|
Problem Voting Script
05/22/2011 - Flyff Private Server - 19 Replies
Habe mal auf ..... Da ich Name nicht sagen darf sage ich auf nem Forum ein Voting Script gedownloadet und die Configs bereits eingeschrieben.
Wenn ich dann http://meineip/vote/vote.php/ eingebe kommt nur ein weißes Bild kann mir einer helfen? ;3.
Config.php
<?php
/*
* Etunia Voting System Lite
|
All times are GMT +1. The time now is 12:13.
|
|