Hola a todos, ya he solucionado el problema que tenía, dejo aquí el código completo por si a alguien más le ocurre el mismo problema.
Código PHP:
<html>
<head>
<meta http-equiv='Content-type' content='text/html; charset=utf-8' />
<title> Ejer 2 </title>
</head>
<body>
<?php
function html_select($name, $array_option){
$html="<select name='$name'>";
for ($i=0;$i<count($array_option);$i++){
if ($array_option[$i]==$name){
$html.="<option value='$name' SELECTED>$array_option[$i]</option></br>";
} else{
$html.="<option value='$array_option[$i]'>$array_option[$i]</option></br>";
}
}
$html.="</select>";
return $html;
}
if (isset($_POST['enviar'])) {
echo "VALORES SELECCIONADOS: ordena_por: $_POST[ordena_por] , reg_por_pag: $_POST[reg_por_pag]";
}
$aOrden = array('id','nombre','mail','curso');
$aRpg = array(10,25,50,100,500);
?>
<form action='ejer2.php' method='post'>
Ordenar por: <?php echo html_select('ordena_por', $aOrden);?>
Registros por pagina: <?php echo html_select('reg_por_pag', $aRpg);?>
<input type='submit' value='Enviar' name='enviar' />
</form>
</body>
</html>