- Joined
- May 8, 2012
- Messages
- 237
- Reaction score
- 75
PHP:
<?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
}
?>
Някой ще помогне ли с вот системата ми искам да отчита при ип адрес ,а не само при "Account"