There is no if/else needed here; not for the redirect, anyway.
That is, if the last action of the 'if' and the 'else' are exactly
the same, that action doesn't belong there at all--it should
be factored out and placed after the construct:
if (something_is_true)
{
perform some actions
redirect back to index.shtml
}
else
{
redirect back to index.shtml
}
can be transformed to the simpler form:
if (something_is_true)
{
perform some actions
}
redirect back to index.shtml
As far as the redirect goes, as long as you haven't output anything yet, you can just set a location header:
header('Location: index.shtml');