Was wondering if anybody had managed to create a back-end/admin to add creatures, realms, items and such? I've tried coding one which adds realms, but its proven a little too difficult.
Any help would be greatly appreciated!
That is true...but wow...think about the security concerns! You would have to do a lot of studying to make sure you had that thing air-tight. If a malicious user got in there, they could basically destroy your game and revert you to the backups you hopefully have.rockinliam wrote:Although it wud be useful if it got to the point wer you required multiple people to manage it and maybe your web host was strict on how many phpmyadmin accounts you could have...
Code: Select all
<?php
include_once 'connect.php';
session_start();
<?php
if (isset($_SESSION['player']))
{
$player=$_SESSION['player'];
}
else
{
echo "Not Logged in <br><br> <A href='login.php'>Login</a>";
exit;
}
?>
<html>
<head>
<style type="text/css">
body { color: #ffffff; font-family: "Lucida Sans Unicode", "Lucida Grande", sans-serif; font-size: 0.6em;}
td {font-size: 0.7em; font-family: "Lucida Sans Unicode", "Lucida Grande", sans-serif;}
input,select { background-color: #171a1b; border: #262a2c; border-width: 1px; border-style: solid; color: #9caaaf; font-family:Arial, Helvetica, sans-serif; font-family: "Lucida Sans Unicode", "Lucida Grande", sans-serif;}
button {font-size: 0.7em; font-family: "Lucida Sans Unicode", "Lucida Grande", sans-serif;}
</style>
</head>
<body bgcolor="black">
<form action="postcreature.php" method="post">
<center>
<table>
<tr>
<td align="center" colspan="2"><b><font color="#ffca4b" style="font-size: 1.1em;">ADD A NEW CREATURE</font></b><br><hr size="1"></td>
</tr>
<tr>
<td align="right">Creature Name:</td><td> <input type="text" name="fname" /></td>
</tr>
<tr>
<td align="right">Race:</td>
<td>
<select name="mydropdown">
<option value="Orc">Orc</option>
<option value="Goblin">Goblin</option>
<option value="Elf">Elf</option>
</select>
</td>
</tr>
<tr>
<td align="right">Strength:</td><td> <input type="text" name="age" /></td>
</tr>
<tr>
<td align="right">Defense:</td><td> <input type="text" name="age" /></td>
</tr>
<tr>
<td align="right">HP:</td><td> <input type="text" name="age" /></td>
</tr>
<tr>
<td align="right">XP:</td><td> <input type="text" name="age" /></td>
</tr>
<tr>
<td align="center" colspan="2"><input type="reset" value="Clear" /> <input type="submit" value="Add Creature" /></td>
</tr>
</table>
</center>
</form>
<br><br>
<form action="postrealm.php" method="post">
<center>
<table>
<tr>
<td align="center" colspan="2"><b><font color="#ffca4b" style="font-size: 1.1em;">ADD A NEW REALM</font></b><br><hr size="1"></td>
</tr>
<tr>
<td align="right">Realm Name:</td><td> <input type="text" name="fname" /></td>
</tr>
<tr>
<td align="right">Region:</td>
<td>
<select name="mydropdown">
<option value="Elkor">Elkor</option>
<option value="Ghal">Ghal</option>
<option value="Zein">Zein</option>
</select>
</td>
</tr>
<tr>
<td align="right">Height (Squares):</td><td> <input type="text" name="age" /></td>
</tr>
<tr>
<td align="right">Width (Squares):</td><td> <input type="text" name="age" /></td>
</tr>
<tr>
<td align="center" colspan="2"><input type="reset" value="Clear" /> <input type="submit" value="Add Realm" /></td>
</tr>
</table>
</center>
</form>
</body>
</html>Code: Select all
if($playerinfo3['admin'] == 1)
{
place all admin code, like menus and such
}
else
{
echo " you are not a admin jackass! get out of the admin panel!!!";
}Ohh yes, alexander19 informed me of creating an admin field in the db. Thanks for the addendum halls, that's perfect!hallsofvallhalla wrote:just place a field in player table called admin
then on page
Code: Select all
if($playerinfo3['admin'] == 1) { place all admin code, like menus and such } else { echo " you are not a admin jackass! get out of the admin panel!!!"; }