Ir para conteúdo

POWERED BY:

Arquivado

Este tópico foi arquivado e está fechado para novas respostas.

razstec

search com opcao

Recommended Posts

Pessoal eu tenho este search em que pretendo que quando a checkbox esta marcada ele envie o valor do input para uma outra pagina e quando nao esta simplesmente abra no google como ja faz agora.

 

<html><head><meta http-equiv="Content-Type" content="text/html; charset=windows-1252"><title>Procura apenas nesta página</title></head><body><form method="get" action="http://www.google.com/search"><div style="border:1px solid black;padding:4px;width:237px;height:63px"><table border="0" cellpadding="0"><tr><td><input type="text"   name="q" size="25" maxlength="255" value="" /><input type="submit" value="Go" /></td></tr><tr><td align="center" style="font-size:75%"><input type="checkbox"  name="sitesearch" value="" checked /> Procura apenas nesta página<br /></td></tr></table></div></form></body></html>

Compartilhar este post


Link para o post
Compartilhar em outros sites

qual a dúvida?ai só tem o código html, cadê a página asp que vai verificar qul checked foi marcado?

Compartilhar este post


Link para o post
Compartilhar em outros sites

eu tava a pensar fazer deste modo:

 

<%Dim textttextt = request.queryString("textt")<%DataPath = Server.MapPath("db/dbsniffitdb.mdb")Set DBCon = Server.CreateObject("ADODB.Connection")DBCon.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & DataPathset rs = Server.CreateObject("ADODB.Recordset")sql = "SELECT * FROM insprocura WHERE artigo LIKE '%" & textt & "%';" set rs =  DBCon.Execute(sql)%><html><head><meta http-equiv="Content-Type" content="text/html; charset=windows-1252"><title>New Page 1</title></head><body><td><% if not rs.eof then %><%=rs.Fields("artigo")%><% else %>nada foi localizado<% end if %></td></table></body></html><%DBCon.CloseSet DBCon = Nothing%>

Compartilhar este post


Link para o post
Compartilhar em outros sites

vê se é isso

<html><head><meta http-equiv="Content-Type" content="text/html; charset=windows-1252"><title>Procura apenas nesta página</title></head><body><form method="post" action="search.asp"><div style="border:1px solid black;padding:4px;width:237px;height:63px"><table border="0" cellpadding="0"><tr><td><input type="text"   name="q" size="25"maxlength="255" value="" /><input type="submit" value="Go" /></td></tr><tr><td align="center" style="font-size:75%"><input type="checkbox"  name="sitesearch"value="sitesearch" checked /> Procura apenas nesta página<br /></td></tr></table></div></form></body></html>
página search.asp

<%Dim textttextt = trim(request.form("q"))sitesearch = request.form("sitesearch")<html><head><meta http-equiv="Content-Type" content="text/html; charset=windows-1252"><title>New Page 1</title></head><body><%if textt<>"" and sitesearch="" thenresponse.redirect(http://www.google.com/search?hl=pt-BR&q="&textt&"&lr=")end ifif textt<>"" and sitesearch="sitesearch" thenDataPath = Server.MapPath("db/dbsniffitdb.mdb")Set DBCon = Server.CreateObject("ADODB.Connection")DBCon.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & DataPathset rs = Server.CreateObject("ADODB.Recordset")sql = "SELECT * FROM insprocura WHERE artigo LIKE '%" & textt & "%';" set rs =  DBCon.Execute(sql)%><td><% if not rs.eof then %><%=rs.Fields("artigo")%><% else %>nada foi localizado<% end if %></td></table><%DBCon.CloseSet DBCon = Nothing%><%elseresponse.write("preencha o campo para pesquisar")end if%></body></html>

Compartilhar este post


Link para o post
Compartilhar em outros sites

independentemente da pesquisa que faça dame istoMicrosoft VBScript compilation error '800a03ee'Expected ')'/sniffit/search.asp, line 14response.redirect(http://www.google.com/search?hl=pt-BR&q="&textt&"&lr=")----------------------^faltava umas aspas no inicio do link, ja actualizei e ta a funcionar na perfeicao :) abrigadissimo mesmoso keria saber metade do que voces sabem...p****!!!

Compartilhar este post


Link para o post
Compartilhar em outros sites

×

Informação importante

Ao usar o fórum, você concorda com nossos Termos e condições.