Call it "vote.php"
This is only the drop downlist pulled for the DB, does not add coins yet !
PHP Code:
<?php
$mssql = array(
'host' => "YOURIP", // 127.0.0.1 or localhost are common used
'user' => "USERNAME", // mostly "sa"
'pass' => "YOURPASSWORD"
);
if(empty($_POST['select'])) {
echo "<center><form action='vote.php' method='POST'>
<table class='innertab'>
<tr>
<td colspan='2' align='left'><b><u>VOTE</b></u></td>
</tr>
<tr>
<td colspan='2' align='left'> </td>
</tr>
<tr>
<td align='left'>Select Character</td>
<td><select name='character_name'>";
$ms_con = mssql_connect($mssql['host'],$mssql['user'],$mssql['pass']);
$result = mssql_query("SELECT * FROM character.dbo.user_character",$ms_con);
while($row = mssql_fetch_row($result)) {
// Look at the list below 2 options
//
//if you want [GM]'s remove the "//" infront of : if(!preg_match("/[[GM]]/i",$row[1])) {
//if you want [DEV]'s remove the "//" infront of : if(!preg_match("/[[DEV]]/i",$row[1])) {
//
// if(!preg_match("/[[GM]]/i",$row[1])) {
if(!preg_match("/[[DEV]]/i",$row[1])) {
if(!preg_match("/[+]/i",$row[1])) {
echo "<option value='".$row[0]."'>".$row[1]."</option>";
}
}
}
echo "</select></td>
</tr>
<tr>
<td align='left' colspan='2'>
<input type='hidden' name='select' value='1'>
<input type='submit' value='Select'>
</td>
</tr>
</table>
</form></center>";
}
?>