<?
session_start();
if($login_username=="") {
Header("Location: login.html");
}
?>
<div align="center">
<?
if($_POST['submit']){
$index = $_POST['index'];
$guild = $_POST['guild'];
$aff = $_POST['aff'];
$connect = include("connect.php");
$sql = 'UPDATE `index` SET `message` = `$index` LIMIT 1;';
if ($connect && mysql_query($sql)) {
echo "Index Message Updated Successfully.<br />";
} else {
echo "Error: pages not updated.<br />";
}
$sql = 'UPDATE `guild` SET `message` = `$guild` LIMIT 1;';
if ($connect && mysql_query($sql)) {
echo "Guild Message Updated Successfully.<br />";
} else {
echo "Error: pages not updated.<br />";
}
if ($aff == "") {echo "There are no affiliates to add!";}
else {
$sql = "INSERT INTO aff VALUES ('$aff')";
if ($connect && mysql_query($sql)) {
echo "Affiliates Updated Successfully.<br />";
} else {
echo "Error: pages not updated.<br />";
}}}
?></div>
<title>Shadow Effect - Admin</title>
<form method="post">
<table width="200" border="1" align="center">
<tr>
<td><div align="center">Index Events </div></td>
<td><textarea id="index" name="index" rows="5" cols="30"><?
include ("connect.php");
$result = mysql_query("select * from `index`");
while($r=mysql_fetch_array($result)) {
$welcome = $r["message"];
echo "$welcome";
} ?></textarea></td>
<td><div align="center">Guild Events </div></td>
<td><textarea id="guild" name="guild" rows="5" cols="30"><? include ("connect.php");
$result = mysql_query("select * from `guild`");
while($r=mysql_fetch_array($result)) {
$message = $r["message"];
echo "$message";
} ?></textarea></td>
<td><div align="center">
<p>Add New Affiliate(This will only change if you enter something.) </p>
</div></td>
<td><input type="text" name="Add_new" /></td>
</tr>
</table>
<p align="center">
<input name="submit" type="submit" value="Submit" onClick='update.php'"/>
<input name="reset" type="reset" value="Reset" />
</p>
<p align="center"> </p>
</form>
for some reason, it won't update the rows... any help?
