това е кода<?php
if($links[$_GET['vote_id']][3])
{
if(isset($_POST['doVote']))
{
$data = array();
$data['accountName'] = $_POST['uss'];
$data['password'] = $_POST['pass'];
$data['character'] = $_POST['character'];
$data['credits'] = $links[$_GET['vote_id']][1];
$data['voteLink'] = $links[$_GET['vote_id']][2];
if(empty($data['accountName']) || empty($data['password']) || empty($data['character']))
{
echo "Please fill all fields .";
}
else
{
//Checks start
$check['account'] = mssql_fetch_array(mssql_query("SELECT AccountID FROM Character Where Name='".$data['character']."'"));
if($check['account']['AccountID'] == $data['accountName'])
{
$check['password'] = mssql_num_rows(mssql_query("select * from MEMB_INFO where memb___id='".$data['accountName']."'"));
if($check['password'] > 0)
{
$check['vote']['accChar'] = mssql_query("select * from votes where accName='".$data['accountName']."' and voteLink='".$_GET['vote_id']."'");
if(mssql_num_rows($check['vote']['accChar']) > 0)
{
header("Location:".$data['voteLink']);
}
else
{
$lastVoteDate = time()+(12*60*60);
$query['getData'] = mssql_fetch_array(mssql_query("select * from memb_info where memb___id='".$data['accountName']."'"));
$query['insertAcc'] = mssql_query("insert into votes(accName, lastVoteDate, voteLink) values('".$data['accountName']."','".$lastVoteDate."', '".$_GET['vote_id']."')");
//Reward
$query['checkCredits'] = mssql_query("select * from MEMB_CREDITS where memb___id='".$data['accountName']."'");
if(mssql_num_rows($query['checkCredits']) < 1)
{
$query['addCredits'] = mssql_query("insert into memb_credits(memb___id, credits) values('".$data['accountName']."', '".$data['credits']."')");
}
else
{
$query['credFetch'] = mssql_fetch_array($query['checkCredits']);
$query['addCredits'] = mssql_query("update MEMB_CREDITS set credits='".($query['credFetch']['credits']+$data['credits'])."' where memb___id='".$data['accountName']."'");
}
$query['insertVotes'] = mssql_query("update memb_info set votes='".($query['getData']['votes']+1)."' where memb___id='".$data['accountName']."'");
header("Location:".$data['voteLink']);
}
}
}
else
{
echo "Incorect account / character .";
}
}
}
?>
<form action="" method="post">
<table cellpadding="0" cellspacing="4" border="0" style="border: 1px outset #000000;" width="250">
<tr>
<td align="left" width="100">Username:</td>
<td align="left"><input type="text" name="uss" length="20">
</tr>
<tr>
<td align="left">Password:</td>
<td align="left"><input type="password" name="pass" length="20">
</tr>
<tr>
<td align="left">Character:</td>
<td align="left"><input type="text" name="character" length="20">
</tr>
<tr>
<td colspan="2" align="right"><input type="submit" name="doVote" value="Vote Now!"></td>
</tr>
<tr>
<td colspan="2" align="left"><a href="javascript:history.go(-1)">Go back to vote list</a></td>
</tr>
</table>
</form>
<?php
}
?>
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[MEMB_Zen]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[MEMB_Zen]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[votes]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[votes]
GO
CREATE TABLE [dbo].[MEMB_CREDITS] (
[memb___id] [varchar] (10) COLLATE Modern_Spanish_CI_AS NOT NULL ,
[money] [int] NOT NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[votes] (
[accName] [varchar] (14) COLLATE Modern_Spanish_CI_AS NOT NULL ,
[lastVoteDate] [int] NOT NULL ,
[voteLink] [int] NULL
) ON [PRIMARY]
GO
alter table memb_info add votes int not null default 0
<form action="" method="post">
<table cellpadding="0" cellspacing="4" border="0" style="border: 1px outset #000000;" width="250">
<tr>
<td align="left" width="100">Username:</td>
<td align="left"><input type="text" name="uss" length="20">
</tr>
<tr>
<td align="left">Password:</td>
<td align="left"><input type="password" name="pass" length="20">
</tr>
<tr>
<td align="left">Character:</td>
<td align="left"><input type="text" name="character" length="20">
</tr>
<tr>
<td colspan="2" align="right"><input type="submit" name="doVote" value="Vote Now!"></td>
</tr>
<tr>
<td colspan="2" align="left"><a href="javascript:history.go(-1)">Go back to vote list</a></td>
</tr>
</table>
</form>
<?php
if($links[$_GET['vote_id']][3])
{
if(isset($_POST['doVote']))
{
$data = array();
$data['accountName'] = $_POST['uss'];
$data['password'] = $_POST['pass'];
$data['character'] = $_POST['character'];
$data['money'] = $links[$_GET['vote_id']][1];
$data['voteLink'] = $links[$_GET['vote_id']][2];
if(empty($data['accountName']) || empty($data['password']) || empty($data['character']))
{
echo "Please fill all fields .";
}
else
{
//Checks start
$check['account'] = mssql_fetch_array(mssql_query("SELECT AccountID FROM Character Where Name='".$data['character']."'"));
if($check['account']['AccountID'] == $data['accountName'])
{
$check['password'] = mssql_num_rows(mssql_query("select * from MEMB_INFO where memb___id='".$data['accountName']."'"));
if($check['password'] > 0)
{
$check['vote']['accChar'] = mssql_query("select * from votes where accName='".$data['accountName']."' and voteLink='".$_GET['vote_id']."'");
if(mssql_num_rows($check['vote']['accChar']) > 0)
{
header("Location:".$data['voteLink']);
}
else
{
$lastVoteDate = time()+(12*60*60);
$query['getData'] = mssql_fetch_array(mssql_query("select * from memb_info where memb___id='".$data['accountName']."'"));
$query['insertAcc'] = mssql_query("insert into votes(accName, lastVoteDate, voteLink) values('".$data['accountName']."','".$lastVoteDate."', '".$_GET['vote_id']."')");
//Reward
$query['Money'] = mssql_query("select * from Character where AccoundID='".$data['accountName']."'");
if(mssql_num_rows($query['Money']) < 1)
{
$query['addmoney'] = mssql_query("insert into Character(AccoundID, Money) values('".$data['accountName']."', '".$data['money']."')");
}
else
{
$query['moneyy'] = mssql_fetch_array($query['money']);
$query['addmoney'] = mssql_query("update Character set Money='".($query['moneyy']['Money']+$data['Money'])."' where AccountID='".$data['accountName']."'");
}
$query['insertVotes'] = mssql_query("update memb_info set votes='".($query['getData']['votes']+1)."' where memb___id='".$data['accountName']."'");
header("Location:".$data['voteLink']);
}
}
}
else
{
echo "Incorect account / character .";
}
}
}
?>
<?php
}
?>
някаква грешка дава ли ти ?
<form action="" method="post">
<table cellpadding="0" cellspacing="4" border="0" style="border: 1px outset #000000;" width="250">
<tr>
<td align="left" width="100">Username:</td>
<td align="left"><input type="text" name="uss" length="20">
</tr>
<tr>
<td align="left">Password:</td>
<td align="left"><input type="password" name="pass" length="20">
</tr>
<tr>
<td align="left">Character:</td>
<td align="left"><input type="text" name="character" length="20">
</tr>
<tr>
<td colspan="2" align="right"><input type="submit" name="doVote" value="Vote Now!"></td>
</tr>
<tr>
<td colspan="2" align="left"><a href="javascript:history.go(-1)">Go back to vote list</a></td>
</tr>
</table>
</form>
<?php
if($links[$_GET['vote_id']][3])
{
if(isset($_POST['doVote']))
{
$data = array();
$data['accountName'] = $_POST['uss'];
$data['password'] = $_POST['pass'];
$data['character'] = $_POST['character'];
$data['money'] = $links[$_GET['vote_id']][1];
$data['voteLink'] = $links[$_GET['vote_id']][2];
if(empty($data['accountName']) || empty($data['password']) || empty($data['character']))
{
echo "Please fill all fields .";
}
else
{
//Checks start
$check['account'] = mssql_fetch_array(mssql_query("SELECT AccountID FROM Character Where Name='".$data['character']."'"));
if($check['account']['AccountID'] == $data['accountName'])
{
$check['password'] = mssql_num_rows(mssql_query("select * from MEMB_INFO where memb___id='".$data['accountName']."'"));
if($check['password'] > 0)
{
$check['vote']['accChar'] = mssql_query("select * from votes where accName='".$data['accountName']."' and voteLink='".$_GET['vote_id']."'");
if(mssql_num_rows($check['vote']['accChar']) > 0)
{
header("Location:".$data['voteLink']);
}
else
{
$lastVoteDate = time()+(12*60*60);
$query['getData'] = mssql_fetch_array(mssql_query("select * from memb_info where memb___id='".$data['accountName']."'"));
$query['insertAcc'] = mssql_query("insert into votes(accName, lastVoteDate, voteLink) values('".$data['accountName']."','".$lastVoteDate."', '".$_GET['vote_id']."')");
//Reward
$query['Money'] = mssql_query("select * from werehouse where AccountID='".$data['accountName']."'");
if(mssql_num_rows($query['Money']) < 1)
{
$query['addmoney'] = mssql_query("insert into warehouse(AccountID, Money) values('".$data['accountName']."', '".$data['money']."')");
}
else
{
$query['moneyy'] = mssql_fetch_array($query['money']);
$query['addmoney'] = mssql_query("update warehouse set Money='".($query['moneyy']['Money']+$data['Money'])."' where AccountID='".$data['accountName']."'");
}
$query['insertVotes'] = mssql_query("update memb_info set votes='".($query['getData']['votes']+1)."' where memb___id='".$data['accountName']."'");
header("Location:".$data['voteLink']);
}
}
}
else
{
echo "Incorect account / character .";
}
}
}
?>
<?php
}
?>
<form action="" method="post">
<table cellpadding="0" cellspacing="4" border="0" style="border: 1px outset #000000;" width="250">
<tr>
<td align="left" width="100">Username:</td>
<td align="left"><input type="text" name="uss" length="20">
</tr>
<tr>
<td align="left">Password:</td>
<td align="left"><input type="password" name="pass" length="20">
</tr>
<tr>
<td align="left">Character:</td>
<td align="left"><input type="text" name="character" length="20">
</tr>
<tr>
<td colspan="2" align="right"><input type="submit" name="doVote" value="Vote Now!"></td>
</tr>
<tr>
<td colspan="2" align="left"><a href="javascript:history.go(-1)">Go back to vote list</a></td>
</tr>
</table>
</form>
<?php
if($links[$_GET['vote_id']][3])
{
if(isset($_POST['doVote']))
{
$data = array();
$data['accountName'] = $_POST['uss'];
$data['password'] = $_POST['pass'];
$data['character'] = $_POST['character'];
$data['money'] = $links[$_GET['vote_id']][1];
$data['voteLink'] = $links[$_GET['vote_id']][2];
if(empty($data['accountName']) || empty($data['password']) || empty($data['character']))
{
echo "Please fill all fields .";
}
else
{
//Checks start
$check['account'] = mssql_fetch_array(mssql_query("SELECT AccountID FROM Character Where Name='".$data['character']."'"));
if($check['account']['AccountID'] == $data['accountName'])
{
$check['password'] = mssql_num_rows(mssql_query("select * from MEMB_INFO where memb___id='".$data['accountName']."'"));
if($check['password'] > 0)
{
$check['vote']['accChar'] = mssql_query("select * from votes where accName='".$data['accountName']."' and voteLink='".$_GET['vote_id']."'");
if(mssql_num_rows($check['vote']['accChar']) > 0)
{
header("Location:".$data['voteLink']);
}
else
{
$lastVoteDate = time()+(12*60*60);
$query['getData'] = mssql_fetch_array(mssql_query("select * from memb_info where memb___id='".$data['accountName']."'"));
$query['insertAcc'] = mssql_query("insert into votes(accName, lastVoteDate, voteLink) values('".$data['accountName']."','".$lastVoteDate."', '".$_GET['vote_id']."')");
//Reward
$query['Money'] = mssql_query("select * from warehouse where AccountID='".$data['accountName']."'");
if(mssql_num_rows($query['Money']) < 1)
{
$query['addmoney'] = mssql_query("insert into warehouse(AccountID, Money) values('".$data['accountName']."', '".$data['money']."')");
}
else
{
$query['moneyy'] = mssql_fetch_array($query['money']);
$query['addmoney'] = mssql_query("update warehouse set Money='".($query['moneyy']['Money']+$data['Money'])."' where AccountID='".$data['accountName']."'");
}
$query['insertVotes'] = mssql_query("update memb_info set votes='".($query['getData']['votes']+1)."' where memb___id='".$data['accountName']."'");
header("Location:".$data['voteLink']);
}
}
}
else
{
echo "Incorect account / character .";
}
}
}
?>
<?php
}
?>