Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

How do I get a simple search box?


johnduo0007

Recommended Posts

This is my search box right now, but I just want a input field and a search button on the right. But I still get the text "search"

 

I've tried everything and can't seem to get a simple input field with the button.

 

 

 

 

<?php

/*

$Id: search.php,v 1.22 2003/02/10 22:31:05 hpdl Exp $

 

osCommerce, Open Source E-Commerce Solutions

http://www.oscommerce.com

 

Copyright © 2003 osCommerce

 

Released under the GNU General Public License

*/

?>

<!-- search //-->

<tr>

<td>

<?php

$info_box_contents = array();

$info_box_contents[] = array('text' => BOX_HEADING_SEARCH);

 

new infoBoxHeading1($info_box_contents, false, false);

 

$info_box_contents = array();

$info_box_contents[] = array('form' => tep_draw_form('quick_find', tep_href_link(FILENAME_ADVANCED_SEARCH_RESULT, '', 'NONSSL', false), 'get'),

'align' => 'center',

'text' => '

<table cellpadding="0" cellspacing="0" border="0">

<tr><td style="width:100%;vertical-align:middle;"><a href="' . tep_href_link(FILENAME_ADVANCED_SEARCH) . '">'.tep_image_button('button_quick_find.gif','',' style="float:right;vertical-align:middle;margin:0px 0px 0px 12px;"').'</a>'. tep_draw_input_field('keywords', '', 'size="10" maxlength="30" style="height:19px; width:150;"') . '' . tep_hide_session_id() . '</td></tr>

</table>

');

 

new infoBox1($info_box_contents);

?>

</td>

</tr>

<!-- search_eof //-->

Link to comment
Share on other sites

You can put this code inside any osc pages. Just don't put it inside of another form.

<?php echo tep_draw_form('quick_find', tep_href_link(FILENAME_ADVANCED_SEARCH_RESULT, '', 'NONSSL', false), 'get') . tep_draw_input_field('keywords', '', 'size="10" maxlength="30" style="width: ' . (BOX_WIDTH-30) . 'px"') . ' ' . tep_hide_session_id() . tep_draw_hidden_field('search_in_description' , '1') . tep_image_submit('button_quick_find.gif', BOX_HEADING_SEARCH) . '</form>';?>

Link to comment
Share on other sites

You can put this code inside any osc pages. Just don't put it inside of another form.

<?php echo tep_draw_form('quick_find', tep_href_link(FILENAME_ADVANCED_SEARCH_RESULT, '', 'NONSSL', false), 'get') . tep_draw_input_field('keywords', '', 'size="10" maxlength="30" style="width: ' . (BOX_WIDTH-30) . 'px"') . ' ' . tep_hide_session_id() . tep_draw_hidden_field('search_in_description' , '1') . tep_image_submit('button_quick_find.gif', BOX_HEADING_SEARCH) . '</form>';?>

 

 

Thank you bktrain! works great, just what I was looking for! thanks again!

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...