ciao a tutti!
ho questo problema ho un multi checkbox che in base a quello che seleziono o no mi deve mostrare i risultati ... allora ecco il codice checkbox
Codice PHP:
<%urlpagina=request.serverVariables("url")
if request.querystring<>"" then urlpagina=urlpagina & "?" & request.querystring
response.write urlpagina
%>
<form method="post" action="../selezionastruttura.asp">
<input type="hidden" name="urlpagina" value="<%= urlpagina %>">
<%struttura=Request.querystring("tipos")
if struttura = "" then
struttura=("2,13,14,23,19,21,3")
else
struttura = struttura
end if
%>
<input <%If InStr(struttura, "2") > 0 Then response.write ("checked='checked'")%> type="checkbox" name="struttura" value="2"> Appartamento</td>
<input <%If InStr(struttura, "13") > 0 Then response.write ("checked='checked'")%> type="checkbox" name="struttura" value="13"> Ostello</td>
<input <%If InStr(struttura, "14") > 0 Then response.write ("checked='checked'")%> type="checkbox" name="struttura" value="14">Albergo</td>
<input <%If InStr(struttura, "23") > 0 Then response.write ("checked='checked'")%> type="checkbox" name="struttura" value="23">Residence
</td>
<input class="red" type="submit" value="[ Filtra ]"></td>
<input <%If InStr(struttura, "19") > 0 Then response.write ("checked='checked'")%> type="checkbox" name="struttura" value="19">Motel</td>
<td align="left"><input <%If InStr(struttura, "21") > 0 Then response.write ("checked='checked'")%> type="checkbox" name="struttura" value="21">Complesso</td>
<td align="left" colspan="2"><input <%If InStr(struttura, "3") > 0 Then response.write ("checked='checked'")%> type="checkbox" name="struttura" value="3">Altre strutture ricettive
pagina selezionastruttura.asp
Codice PHP:
<%@ Language = "VBScript" %>
<%
dim tipistruttura
tipistruttura=Request.Form("struttura")
vai_a= Request.Form("urlpagina")
tipistruttura=Replace(tipistruttura," ","")
Response.Redirect (vai_a&"?tipos="&tipistruttura)
%>
ecco il/i problemi:
apro la pagina prova.asp digitando url nel browser tutto ok tutti i campi sono fleggati
può essere che io desideri cambiare la lingua ecco che la mia pagina diventa
prova.asp?lang=en
desidero cambiare ordine la mia pagina diventa
prova.asp?lang=en&order=1
ora desidero togliere alcuni flag ecco l'errore ovvio perchè la mia pagina diventerà
prova.asp?lang=en&order=1?tops=3,21
può essere che io rimetta i flag ecco che la mia pagina diventa
prova.asp?lang=en&order=1?tops=3,21?tops=19
insomma un po' di casino .. vorrei risolvere qusti piccoli bug ..qualche consiglio