Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> Problem z wyświetleniem wyniku zapytania w tabelce
legrooch1
post
Post #1





Grupa: Zarejestrowani
Postów: 2
Pomógł: 0
Dołączył: 3.03.2005

Ostrzeżenie: (0%)
-----


Witam!
Zacząłem zabawę php i natrafiłem na problem.
Próbuję zrealizować następującą stronkę:
Strona robocza

Jeżeli w wyszukiwarce wpiszę np. wd, rezultat zastępuje całą stronę.
Co powinienem zrobić, aby wynik wyświetlał się w środkowej części?

Kod wyszukiwarki:
Kod
<?php
  require('includes/application_top.php');
  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_ADVANCED_SEARCH);
  $breadcrumb->add(NAVBAR_TITLE_1, tep_href_link(FILENAME_ADVANCED_SEARCH));
?>
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html <?php echo HTML_PARAMS; ?>>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">
<title><?php echo TITLE; ?></title>
<link rel="stylesheet" type="text/css" href="stylesheet.css">
<script language="javascript" src="includes/general.js"></script>
<script language="javascript"><!--
function check_form() {
  var error_message = "<?php echo JS_ERROR; ?>";
  var error_found = false;
  var error_field;
  var keywords = document.advanced_search.keywords.value;
  var dfrom = document.advanced_search.dfrom.value;
  var dto = document.advanced_search.dto.value;
  var pfrom = document.advanced_search.pfrom.value;
  var pto = document.advanced_search.pto.value;
  var pfrom_float;
  var pto_float;

  if ( ((keywords == '') || (keywords.length < 1)) && ((dfrom == '') || (dfrom == '<?php echo DOB_FORMAT_STRING; ?>') || (dfrom.length < 1)) && ((dto == '') || (dto == '<?php echo DOB_FORMAT_STRING; ?>') || (dto.length < 1)) && ((pfrom == '') || (pfrom.length < 1)) && ((pto == '') || (pto.length < 1)) ) {
    error_message = error_message + "* <?php echo ERROR_AT_LEAST_ONE_INPUT; ?>\n";
    error_field = document.advanced_search.keywords;
    error_found = true;
  }

  if (error_found == true) {
    alert(error_message);
    error_field.focus();
    return false;
  } else {
    RemoveFormatString(document.advanced_search.dfrom, "<?php echo DOB_FORMAT_STRING; ?>");
    RemoveFormatString(document.advanced_search.dto, "<?php echo DOB_FORMAT_STRING; ?>");
    return true;
  }
}

function popupWindow(url) {
  window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,re
izable=yes,copyhistory=no,width=450,height=280,screenX=150,screenY=150,top=150,l
ft=150')
}
//--></script>
</head>
<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0">

<!-- body //-->
<table border="0" width="100%" cellspacing="0" cellpadding="0">
  <tr>
<!-- body_text //-->
    <td width="100%" valign="top">
<?php echo tep_draw_form('advanced_search', tep_href_link(FILENAME_ADVANCED_SEARCH_RESULT), 'get', 'onSubmit="return check_form(this);"') . tep_hide_session_id();

//echo tep_draw_form('advanced_search', tep_href_link(FILENAME_ADVANCED_SEARCH_RESULT, '', 'NONSSL', false), 'get', 'onSubmit="return //check_form(this);"') . tep_hide_session_id();
?>
<table border="0" width="100%" cellspacing="0" cellpadding="0">
      <tr>
        <td>
<?php
  $info_box_contents = array();
  $info_box_contents = array();
  $info_box_contents[] = array('text' => tep_draw_input_field('keywords', '', 'style="width: 100%"'));
  new infoBox($info_box_contents);
?>
        </td>
      </tr>
      <tr>
        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
          <tr>
            <td class="smallText" align="right"><?php echo tep_image_submit('button_search.gif', IMAGE_BUTTON_SEARCH); ?></td>
          </tr>
        </table></td>
      </tr>
    </table></form></td>
  </tr>
</table>
</body>
</html>


Dziękuję za podpowiedź/odpowiedź.

Ten post edytował legrooch1 3.03.2005, 09:52:50
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi (1 - 3)
Kuziu
post
Post #2





Grupa: Zarejestrowani
Postów: 743
Pomógł: 0
Dołączył: 11.11.2003
Skąd: Toruń

Ostrzeżenie: (0%)
-----


Poczytaj o include()
Go to the top of the page
+Quote Post
donpablo
post
Post #3





Grupa: Zarejestrowani
Postów: 55
Pomógł: 0
Dołączył: 28.02.2005

Ostrzeżenie: (0%)
-----


zrób plik sterujący np. index.php, podziel go za pomocą tabel HTML na kolumny i komórki i użyj instrukcji include() do dołączania plików. Oczywiście plik index.php musie być dopisany do każdego linku. Dodtakowa należy użyć jakiejś zmiennej sterującej na podstawie której będzie dołączany odpowiedni plik. Przykładowy link może być taki: www.xxx.pl?id=1. Taki sposób to standard, czeka cie troche pracy ale zdynamizuje całkowicie twoją strone
Go to the top of the page
+Quote Post
legrooch1
post
Post #4





Grupa: Zarejestrowani
Postów: 2
Pomógł: 0
Dołączył: 3.03.2005

Ostrzeżenie: (0%)
-----


Dzięki chłopaki za odpowiedź!
Siadam do roboty (IMG:http://forum.php.pl/style_emoticons/default/smile.gif)
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 23.08.2025 - 06:33