06/12/2016, 21:01
|
| | Fecha de Ingreso: abril-2014
Mensajes: 18
Antigüedad: 10 años, 6 meses Puntos: 0 | |
Combo Hola.
He realizado este combo, pretendo que haga lo siguiente:
Que coja el valor de cada uno de los SELECT, y dependiendo de la seleccion vaya a una URL concreta.
Ejemplo:
url/category-location
urlbase/coches-madrid
¿Alguien sabria como hacerlo con PHP?
Un saludo
Código:
<!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=utf-8" />
<title>Untitled Document</title>
<style type="text/css">
.form1 {
display: table-cell; /* or inline */
}
.form2 {display: table-cell;
/* or inline */}
#searchFilterBox{display:block;background:#434343;box-shadow:0 2px 10px 0 rgba(0,0,0,0.45);border-bottom:1px solid #333;text-align:center;width:100%; box-sizing:border-box; }
#ba-search-box{width:1000px;text-align:center;box-sizing:border-box;margin:auto;padding:0 0 8px 0;}
.searchFilter{padding:5px 0 5px 10px;margin:0 5px 5px 0;background:#f2f2f2;color:#6a6a6a !important;display:inline-block;border:2px solid #ffaa22;border-radius:13px;font-weight:bold;font-size:13px}
.searchFilterVerbose{display:inline-block;font-weight:bold;margin:0 5px 0 0;font-size:13px;color:#efefef}
a.searchFilter:hover{background-color:#ffec64;color:#000 !important;text-decoration:none}
.body-topsearch #content{margin-top:105px !important}
.body-topsearch-active #content{margin-top:135px !important}
.ba-search-field{display:table-cell;padding:5px 0}
.ba-search-field input,.ba-search-field select,.ba-search-field button{padding:5px;border-radius:5px;font-weight:bold;color:#777;font-size:14px;border:2px inset #ffaa22;display:inline-block;box-sizing:border-box}
.ba-search-field select{padding:2px 5px !important;cursor:pointer}
.ba-search-field{ margin-left:0px;}
.ba-search-field input,.ba-search-field select,.ba-search-field button{min-width:100px}
.ba-search-fieldd{display:table-cell;padding:5px 0,;}
.ba-search-fieldd input,.ba-search-fieldd select,.ba-search-fieldd button{padding:5px;border-radius:5px;font-weight:bold;color:#777;font-size:14px;border:2px inset #ffaa22;display:inline-block;box-sizing:border-box}
.ba-search-fieldd select{padding:2px 5px !important;cursor:pointer}
.ba-search-fieldd{width:auto; margin-left:0px;}
.ba-search-fieldd input,.ba-search-fieldd select,.ba-search-fieldd button{min-width:200px}
button.ba-search-btn1{background: #F00;background:#F00 linear-gradient(to bottom, #ffec64 5%, #F00 100%) repeat scroll 0 0;border:1px solid #ffaa22;text-shadow:0 1px 0 #ffee66;border-radius:6px;color:#333}
button.ba-search-btn2{background:#ffec64;background:#ffec64 linear-gradient(to bottom, #ffec64 5%, #ffab23 100%) repeat scroll 0 0;border:1px solid #ffaa22;text-shadow:0 1px 0 #ffee66;border-radius:6px;color:#333}
button.ba-search-btn1{width:100px !important;min-width:100px !important}
button.ba-search-btn1{cursor:pointer;padding:5px 12px}
button.ba-search-btn2{width:100px !important;min-width:100px !important}
button.ba-search-btn2{cursor:pointer;padding:5px 12px}
button.ba-search-btn1:hover{background: #F00;background:#F00 linear-gradient(to bottom, #ffab23 5%, #ffec64 100%) repeat scroll 0 0}
button.ba-search-btn2:hover{background:#ffab23;background:#ffab23 linear-gradient(to bottom, #ffab23 5%, #ffec64 100%) repeat scroll 0 0}
input.ba-search-free{position:relative;}
div.ba-search-free:after{font-family:"Trebuchet MS", sans-serif;position:relative;font-size:130%;color:#aaa;box-sizing:border-box; height:40px;}
.ba-search-cat {font-family:"Trebuchet MS", sans-serif; height:40px; margin-left:0px; min-width:100px; width:220px;}
.ba-search-loc {font-family:"Trebuchet MS", sans-serif; height:40px; width:200px; margin-left:10px; }
.ba-search-free {font-family:"Trebuchet MS", sans-serif;margin-top:10px; margin-left:95px; height:40px; width:250px;}
.ba-search-btn1 {font-family:"Trebuchet MS", sans-serif;margin-left:10px; height:40px;}
.ba-search-btn2 {font-family:"Trebuchet MS", sans-serif;margin-left:10px;height:40px;}
</style>
</head>
<body>
<div id="searchFilterBox">
<div id="ba-search-box">
<form class="form1" id="searchform" method="get" action="<?php bloginfo('home'); ?>" >
<div class="ba-search-field">
<select class="ba-search-cat" name="category">
<option value="#">Selecciona una categoria</option>
<option value="trabajo">Trabajo</option>
<option value="cursos">Cursos</option>
<option value="coches">Coches</option>
</select>
</div>
<div class="ba-search-field"> <select class="ba-search-loc" name="location">
<option value="#">Elige una ciudad</option>
<option value="madrid">Madrid</option>
<option value="barcelona">Barcelona</option>
<option value="valencia">Valencia</option>
<option value="malaga">Málaga</option>
<option value="a_coruna">A Coruña</option>
<option value="alava">Álava</option>
<option value="albacete">Albacete</option>
<option value="alicante">Alicante</option>
<option value="almeria">Almería</option>
<option value="asturias">Asturias</option>
<option value="avila">Ávila</option>
<option value="badajoz">Badajoz</option>
<option value="baleares">Baleares</option>
<option value="burgos">Burgos</option>
<option value="caceres">Cáceres</option>
<option value="cadiz">Cádiz</option>
<option value="cantabria">Cantabria</option>
<option value="castellon">Castellón</option>
<option value="ceuta">Ceuta</option>
<option value="ciudad_real">Ciudad Real</option>
<option value="cordoba">Córdoba</option>
<option value="cuenca">Cuenca</option>
<option value="el_hierro-tenerife">El Hierro</option>
<option value="fuerteventura-las_palmas">Fuerteventura</option>
<option value="girona">Girona</option>
<option value="granada">Granada</option>
<option value="guadalajara">Guadalajara</option>
<option value="guipuzcoa">Guipúzcoa</option>
<option value="huelva">Huelva</option>
<option value="huesca">Huesca</option>
<option value="ibiza-baleares">Ibiza</option>
<option value="jaen">Jaén</option>
<option value="la_rioja">La Rioja</option>
<option value="lanzarote-las_palmas">Lanzarote</option>
<option value="la_gomera-tenerife">La Gomera</option>
<option value="la_palma-tenerife">La Palma</option>
<option value="gran-canaria">Las Palmas de Gran Canaria</option>
<option value="leon">León</option>
<option value="lleida">Lleida</option>
<option value="lugo">Lugo</option>
<option value="melilla">Melilla</option>
<option value="menorca-baleares">Menorca</option>
<option value="murcia">Murcia</option>
<option value="navarra">Navarra</option>
<option value="ourense">Ourense</option>
<option value="palencia">Palencia</option>
<option value="palma_de_mallorca-baleares">Palma de Mallorca</option>
<option value="pontevedra">Pontevedra</option>
<option value="salamanca">Salamanca</option>
<option value="segovia">Segovia</option>
<option value="sevilla">Sevilla</option>
<option value="soria">Soria</option>
<option value="tarragona">Tarragona</option>
<option value="tenerife">Tenerife</option>
<option value="teruel">Teruel</option>
<option value="toledo">Toledo</option>
<option value="valladolid">Valladolid</option>
<option value="vizcaya">Vizcaya</option>
<option value="zamora">Zamora</option>
<option value="zaragoza">Zaragoza</option>
</select>
</div>
<div class="ba-search-field ba-search-btn1"> <button class="ba-search-btn1" id="ba-search-searchBtn">Ir</button> </div>
</form>
</div>
</div>
</body>
</html>
|