<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Unire codice di 2 pagine php in 1]]></title><description><![CDATA[<p dir="auto">Salve, mi servirebbe un piccolo aiutino per un pezzo di codice, e di una pagina prodotto di oscommerce, dovrei sostituire un richiamo di codice direttamente con il codice ossia il:</p>
<pre><code class="language-html"> require(DIR_WS_INCLUDES . 'template_top.php');
</code></pre>
<p dir="auto">praticamente richiama il codice head da un'altro file:</p>
<pre><code class="language-html">&lt;?php
/*
  $Id$
  osCommerce, Open Source E-Commerce Solutions
  http://www.oscommerce.com
  Copyright (c) 2010 osCommerce
  Released under the GNU General Public License
*/
  $oscTemplate-&gt;buildBlocks();
  if (!$oscTemplate-&gt;hasBlocks('boxes_column_left')) {
    $oscTemplate-&gt;setGridContentWidth($oscTemplate-&gt;getGridContentWidth() + $oscTemplate-&gt;getGridColumnWidth());
  }
  if (!$oscTemplate-&gt;hasBlocks('boxes_column_right')) {
    $oscTemplate-&gt;setGridContentWidth($oscTemplate-&gt;getGridContentWidth() + $oscTemplate-&gt;getGridColumnWidth());
  }
?&gt;
&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
&lt;html xmlns="http://www.w3.org/1999/xhtml" &lt;?php echo HTML_PARAMS; ?&gt;&gt;
&lt;head&gt;
&lt;meta http-equiv="Content-Type" content="text/html; charset=&lt;?php echo CHARSET; ?&gt;" /&gt;
&lt;title&gt;&lt;?php echo tep_output_string_protected($oscTemplate-&gt;getTitle()); ?&gt;&lt;/title&gt;
&lt;?php include_once DIR_WS_MODULES . 'kiss_meta_tags/kiss_meta_tags.php'; ?&gt;
&lt;base href="&lt;?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?&gt;" /&gt;
&lt;link rel="stylesheet" type="text/css" href="ext/jquery/ui/redmond/jquery-ui-1.8.6-osc.css" /&gt;
&lt;script type="text/javascript" src="ext/jquery/jquery-1.4.2.min.js"&gt;&lt;/script&gt;
&lt;script type="text/javascript" src="ext/jquery/ui/jquery-ui-1.8.6.min.js"&gt;&lt;/script&gt;
&lt;?php
  if (tep_not_null(JQUERY_DATEPICKER_I18N_CODE)) {
?&gt;
&lt;script type="text/javascript" src="ext/jquery/ui/i18n/jquery.ui.datepicker-&lt;?php echo JQUERY_DATEPICKER_I18N_CODE; ?&gt;.js"&gt;&lt;/script&gt;
&lt;script type="text/javascript"&gt;
$.datepicker.setDefaults($.datepicker.regional['&lt;?php echo JQUERY_DATEPICKER_I18N_CODE; ?&gt;']);
&lt;/script&gt;
&lt;?php
  }
?&gt;
&lt;script type="text/javascript" src="ext/jquery/bxGallery/jquery.bxGallery.1.1.min.js"&gt;&lt;/script&gt;
&lt;link rel="stylesheet" type="text/css" href="ext/jquery/fancybox/jquery.fancybox-1.3.4.css" /&gt;
&lt;script type="text/javascript" src="ext/jquery/fancybox/jquery.fancybox-1.3.4.pack.js"&gt;&lt;/script&gt;
&lt;link rel="stylesheet" type="text/css" href="ext/960gs/&lt;?php echo ((stripos(HTML_PARAMS, 'dir="rtl"') !== false) ? 'rtl_' : ''); ?&gt;960_24_col.css" /&gt;
&lt;link rel="stylesheet" type="text/css" href="css/stylesheet.css" /&gt;
&lt;link rel="stylesheet" type="text/css" href="css/constants.css" /&gt;
&lt;link rel="stylesheet" type="text/css" href="css/stylesheet_boxes.css" /&gt;
&lt;link rel="stylesheet" type="text/css" href="css/header.css" /&gt;
&lt;?php require('ext/js/ie6/ie6.php');?&gt;
&lt;?php include(DIR_WS_FUNCTIONS . 'case_page.php');?&gt;
&lt;?php echo $oscTemplate-&gt;getBlocks('header_tags');?&gt;
&lt;link rel="stylesheet" type="text/css" href="css/style.css" /&gt;

&lt;script type="text/javascript" src="ext/js/loopedslider.0.5.4.js"&gt;&lt;/script&gt;
&lt;script type="text/javascript" charset="utf-8"&gt;
 $(function(){
  $('#loopedSlider').loopedSlider();
 });
&lt;/script&gt;
&lt;?php
   if (!isset($lng) || (isset($lng) &amp;&amp; !is_object($lng))) {
     include_once(DIR_WS_CLASSES . 'language.php');
     $lng = new language;
   }
   reset($lng-&gt;catalog_languages);
   while (list($key, $value) = each($lng-&gt;catalog_languages)) {
 ?&gt;
         &lt;link rel="alternate" type="application/rss+xml" title="&lt;?php echo STORE_NAME . ' - ' . BOX_INFORMATION_RSS; ?&gt;" href="&lt;?php echo FILENAME_RSS, '?language=' . $key.((isset($_GET['cPath']))?'&amp;amp;cPath='.$_GET['cPath']:'').((isset($_GET['manufacturers_id']))?'&amp;amp;manufacturers_id='.$_GET['manufacturers_id']:''); ?&gt;" /&gt;
          &lt;?php
          }
          ?&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;div id="bodyWrapper" class="container_24"&gt;
&lt;?php require(DIR_WS_INCLUDES . 'header.php'); ?&gt;
&lt;div id="bodyContent" class="grid_16 push_4"&gt;
</code></pre>
<p dir="auto">Il codice postato sopra dovrei inserirlo in quest'altro file:</p>
<pre><code class="language-html">&lt;?php
/*
  $Id$
  osCommerce, Open Source E-Commerce Solutions
  http://www.oscommerce.com
  Copyright (c) 2010 osCommerce
  Released under the GNU General Public License
*/
  require('includes/application_top.php');
  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_PRODUCT_INFO);
  $product_check_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'");
  $product_check = tep_db_fetch_array($product_check_query);
  require(DIR_WS_INCLUDES . 'template_top.php');
  if ($product_check['total'] &lt; 1) {
?&gt;
&lt;div class="contentContainer"&gt;
  &lt;div class="contentText"&gt;
    &lt;?php echo TEXT_PRODUCT_NOT_FOUND; ?&gt;
  &lt;/div&gt;
  &lt;div style="float: right;"&gt;
    &lt;?php echo tep_draw_button(IMAGE_BUTTON_CONTINUE, 'triangle-1-e', tep_href_link(FILENAME_DEFAULT)); ?&gt;
  &lt;/div&gt;
&lt;/div&gt; ecc.....
</code></pre>
<p dir="auto">Come faccio per unirli? Grazie</p>
]]></description><link>https://dev.connect.gt/topic/154718/unire-codice-di-2-pagine-php-in-1</link><generator>RSS for Node</generator><lastBuildDate>Thu, 26 Nov 2026 03:24:00 GMT</lastBuildDate><atom:link href="https://dev.connect.gt/topic/154718.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 07 Jul 2011 20:38:59 GMT</pubDate><ttl>60</ttl></channel></rss>