The first thing that I didn't understand is where $status is coming from. With that in mind, it might be a good idea to write down op paper what your script has to do in normal writing before making it. This will help you figure out the steps you have to take and will speed up the process rather than continuous trial and error.
A few things I'd like to ask about this script first however.
1. What is the first if statement for?
Is this to control if the page name has been set? If so you will also want to check the REQUEST_URI to make sure you're on the template's script page and not the script itself.
Code: Select all
if( isset($_GET['id']) && $_SERVER['REQUEST_URI'] == '/index.php' )
. Otherwise I could type in the path to your script and still pass an id to it, making this check useless.
2. You might need to control more on how you insert information in your SQL queries:
Code: Select all
$warriorinfo="SELECT * FROM `characters` WHERE `cid`='$cid'";
$warriorinfo2=mysql_query($warriorinfo) or die("could not get character stats!");
$warriorinfo3=mysql_fetch_array($warriorinfo2);
If I were to change the url to something like:
Code: Select all
http://example.com/page.php?id=whatever&cid=1' OR '2
Your SQL query would now look like:
Code: Select all
SELECT * FROM `characters` WHERE `cid`='1' OR '2'
You might as well just be saying goodbye to your database when a hacker finds out he can have some fun. Always use proper injection control. Here's a good tutorial:
http://www.tizag.com/mysqlTutorial/mysq ... ection.php
Onto what the script has to do. I read through your code and guessed you have a table with a list of characters in the arena called ffatb. Then you go onto a bit that checks the arena status to see whether or not it is closed, this is where you randomly call a variable $status from nowhere. I think you forgot to complete your script again
good luck

Fighting for peace is declaring war on war. If you want peace be peaceful.