No se si sea muy optimo o no pero yo lo hago asi...
Código PHP:
<?php
@include("includes/conexion.php");
header('Server: Apache');
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Habilidad</title>
<?php @include 'includes/styles.php';?>
</head>
<body>
<?php @include 'includes/logo.php';?>
<?php session_start();
if(isset($_SESSION['tipo']))
{
if($_SESSION['tipo']==3){
@include("includes/menuadmin.php");
}
}
?>
<br></br>
<?php
$_SESSION['valid_user'];
if(!isset($_SESSION['valid_user'])&& $_SESSION['tipo']!=3)header("location: includes/error.php");//sino es admin para unauthorized
$idEmpleado= $_SESSION['valid_user'];
conectar();
if(!isset($_POST['Accion']))
{
echo'<form name=Accion action="" method=post>
<center>
<br>
Por Favor Seleccione Lo Que Desea Realizar
<select name="Accion">
<option value="1">Agregar Habilidad</option>
<option value="2">Modificar Habilidad</option>
<option value="3">Eliminar Habilidad</option>
</select>
<input type="submit" name="Seleccionar" value="Seleccionar" class="button" />
</center>
</form>
';}
if(isset($_POST['Accion']))
{
$Accion= $_POST['Accion'];
switch ($Accion) {
case 1:
header("location: agregarhabilidad.php");break;
case 2:
header("location: modificarhabilidad.php");break;
case 3:
header("location: eliminarhabilidad.php");break;
}
}
?>
</body>
</html>