Y lo del Select lo hice asi:
Código PHP:
Ver originalfunction Agregar_Lista($parametro) {
global $variable_html;
if ($GLOBALS["direccion"] == $parametro) {
$variable_html = $variable_html . " " . "<option value='$parametro' selected>" . $parametro . "</option>";
} else {
$variable_html = $variable_html . " " . "<option value='$parametro' >" . $parametro . "</option>";
}
//$variable_html = $variable_html . " " . "<option value='$parametro' >" . $parametro . "</option>";
}
Así no tengo que hacer ningún calculo solo comprobación