Bom conselho
É o seguinte. Eu tenho a tabela alunosso na pagina SO.php. E tenho igualmente na mesma página o botão do qual aqui se falou na mesmo página. E quando eu carrego no botão, ok ele apaga a tabela, no entanto no ecrâ a tabela ainda "existe", sendo necessário actualizar a página manualmente para a tabela "desaparecer" e dar a informação "não existem alunos registados".
Código:
[LEFT] [COLOR=#000000] [COLOR=#0000bb]<?php
[/COLOR][COLOR=#007700]if (isset([/COLOR][COLOR=#0000bb]$_POST[/COLOR][COLOR=#007700][[/COLOR][COLOR=#dd0000]'button'[/COLOR][COLOR=#007700]]) && ![/COLOR][COLOR=#0000bb]strcmp[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]$_POST[/COLOR][COLOR=#007700][[/COLOR][COLOR=#dd0000]'button'[/COLOR][COLOR=#007700]],[/COLOR][COLOR=#dd0000]""[/COLOR][COLOR=#007700])){
[/COLOR][COLOR=#0000bb]mysql_query[/COLOR][COLOR=#007700]([/COLOR][COLOR=#dd0000]"DROP table alunosso"[/COLOR][COLOR=#007700]);
unset([/COLOR][COLOR=#0000bb]$_POST[/COLOR][COLOR=#007700][[/COLOR][COLOR=#dd0000]'button'[/COLOR][COLOR=#007700]]);
echo [/COLOR][COLOR=#dd0000]"<script type='text/javascript' language='javascript'>window.location.reload();</script>"[/COLOR][COLOR=#007700];
}
[/COLOR][COLOR=#0000bb]?>
[/COLOR]<form method="post" action="teste.php">
<button type="submit" name="button" value="button">Button</button>
<button type="submit" name="clear" value="clear">Clear</button>
</form>[/COLOR] [/LEFT]
Eu uso o script em javascript que aí está para quando fazer o back button e nessa situação funciona. No entanto, assim, não funciona