Well, I don't understand your description that much, and your code is awfully hard to read (partly because there are more { in it than }). My preferred style would see this code written more like:
if ($enableallowedurl == "checked")
{ if ($HTTP_REFERER == "$allowedurl")
{ if ($enabledmaxdirsize == "checked")
{ if ($spaceused < "$maxdirsize")
{ if ($enabledmaxfilesize == "checked")
{ if ($maxfilesize < "$maxfilesize")
{ uploadfile();
}
else
{ print "$pagelooks$fontformat$maxfilesizeerror";
}
}
else
{ //doesnt use max file sizes
}
One of the things that makes it look incomplete is that part reads:
if($enabledmaxdirsize == 'checked')
{ //stuff
}
else
{ if($enabledmaxdirsize == 'checked')
{ //more stuff
}
}
It's fairly obvious that "more stuff" will never happen. A few lines later is
else
( //doesnt use max dir
}
elseif ($enabledmaxdirsize == "checked")
{ if ($spaceused < "$maxdirsize")
{ elseif ($enabledmaxfilesize == "checked")
In which (a) the $enabledmaxdirsize test is still automatically false and (b) syntactically dodgy. If you're going to test $enabledmaxsize so often, why not do so early on in the piece and get it out of the way once and for all?
It also sounds as if many bits of this should be farmed out to functions - each dealing with one major branch (returning true or with results if they went ahead or false if their own tests failed).