Forum Moderators: coopster
<?php
$con = mysql_connect("localhost","Pass","Pass");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("DBNAME", $con);
$out = '<u>Log:</u>';
$sql = "INSERT INTO Sky_Points (Username, Points, PointsSinceLastPayOut, DateofLastRun) VALUES ('$_POST[Username]','$_POST[Points]','$_POST[PointsSinceLastPayOut])','$_POST[DateofLastRun]')";
if (!mysql_query($sql,$con))
{
die('Error: ' . mysql_error());
}
$out = '<br />Player added.';
echo $out;
echo '<br /><br /><a href="http://URL" style="font-size: large">Back to Admin main page</a>';
echo '<br /><a href="http://URL.php" style="font-size: large">Back to SKY Add Player page</a>';
?>
<?php
$con = mysql_connect("localhost","Pass","Pass");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("DBNAME", $con);
$formtable = '<form action="skyaddplayer.php" method="post" onKeyPress="return event.keyCode!=13"><table id="form" cellspacing="2" align="center">
<tr>
<th style="text-align: center;">Player Name</th>
<td style="text-align: center;"><input type="text" name="Username" /></td>
</tr>';
$formtable .= "\n" . '<tr>
<th style="text-align: center;">Points</th>
<td style="text-align: center;"><input type="text" name="Points" /></td>
</tr>';
$formtable .= "\n" . '<tr>
<th style="text-align: center;">Points since last pay out</th>
<td style="text-align: center;"><input type="text" name="PointsSinceLastPayOut" /></td>
</tr>';
$formtable .= "\n" . '<tr>
<th style="text-align: center;">Date of last run</th>
<td style="text-align: center;"><input type="text" name="DateofLastRun" /></td>
</tr>';
$formtable .= "\n" . '<tr>
<td style="text-align: center;"><input name="submit"" type="submit" value="Add Player!"> </td>
<td style="text-align: center;"><input name="Reset" type="reset" value="Reset Changes"></td>
</tr>';
$formtable .= "\n" . '</table>';
echo $formtable;
?>