← Desenvolvimento

caixa de pesquisa

Lida 2071 vezes

Offline

anaribeiro 
Membro
Mensagens 32 Gostos 0
Troféus totais: 17
Trófeus: (Ver todos)
Super Combination Combination Topic Starter Level 3 Level 2 Level 1 10 Posts First Post Karma Webmaster

alguém me pode dizer como se cria uma caixa de pesquisa (com códigos, se possivel) para um site?

obrigada
Offline

Rogério Moreira 
Editor
Mensagens 1313 Gostos 11
Feedback +15

Troféus totais: 32
Trófeus: (Ver todos)
Level 6 Tenth year Anniversary Nineth year Anniversary Eighth year Anniversary Super Combination Combination Topic Starter 10 Poll Votes Poll Voter Poll Starter

Citar
<form id="searchthis" action="/search" style="display:inline;" method="get">
<table border="0" width="200" cellspacing="5">
<tr>
<td valign="middle"><input id="search-box" style="font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 15px; color: #000000; border: 1px solid #000000; width: 100px;" name="q" type="text" /></td>
<td valign="middle"><input id="search-btn" style=" color: #000000; background- border: 1px solid #000000; font-weight: bold; padding: 4px;" value="Pesquisar" type="submit" />
</td>
</tr>
</table>
</form>

Aqui tens!
Offline

anaribeiro 
Membro
Mensagens 32 Gostos 0
Troféus totais: 17
Trófeus: (Ver todos)
Super Combination Combination Topic Starter Level 3 Level 2 Level 1 10 Posts First Post Karma Webmaster

é possivel dizer-me como posso configurar o conteúdo da caixa de pesquisa com o conteúdo do site.
ou seja, coloco uma palavra na caixa da pesquisa, e automaticamente encontra essa mesma palavra no site.

obrigada
Offline

rtbfreitas 
Equipa
Mensagens 1497 Gostos 9
Feedback +24

Troféus totais: 30
Trófeus: (Ver todos)
Windows User Apple User Super Combination Combination Topic Starter 10 Poll Votes Poll Voter Poll Starter Level 5 Level 4

@rogerio58

tabelas para quê?

@anaribeiro

Código: [Seleccione]
<form id="pesquisa" action="" method="get">
    <input type="search" name="q" value="Pesquisar..."  />
    <input type="submit" value="Pesquisar" />
</form>
Offline

dardevelin 
Membro
Mensagens 249 Gostos 0
Troféus totais: 21
Trófeus: (Ver todos)
Linux User Super Combination Combination Topic Starter Poll Voter Level 4 Level 3 Level 2 Level 1 100 Posts

Boas, aqui tens e já com o php para wordpress, usas o css para editares o que quiseres a nível de visual ;)

Código: [Seleccione]
<?php $search_text = empty($_GET['s']) ? "Search" get_search_query(); ?>
<div id="search">
    <form method="get" id="searchform" action="<?php bloginfo('home'); ?>/">
        <input type="text" value="<?php echo $search_text?>"
            name="s" id="s"  onblur="if (this.value == '')  {this.value = '<?php echo $search_text?>';}" 
            onfocus="if (this.value == '<?php echo $search_text?>') {this.value = '';}" />
        <input type="image" src="<?php bloginfo('template_url'); ?>/images/search.gif" style="border:0; vertical-align: top;" />
    </form>
</div>
Offline

anaribeiro 
Membro
Mensagens 32 Gostos 0
Troféus totais: 17
Trófeus: (Ver todos)
Super Combination Combination Topic Starter Level 3 Level 2 Level 1 10 Posts First Post Karma Webmaster

o site esta em html, css, php