PHP help please...

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Jace
    FBOP Class Of 2013
    • Jan 2004
    • 35562

    #1

    PHP help please...

    I want to include main_content.php in this...it is from oscommerce, the includes/language/english/index.php file...how can I set a php as an include in this, it is not letting me

    the <?php include("main_content.php"); ?> is what I am trying to include...do I have to have a different code when I am already on a php page? like an echo or something?

    Code:
    define('TEXT_MAIN', '' . tep_image(DIR_WS_IMAGES . 'default/greeting.jpg') . '<hr width="375" size="1" color="#000000"><br><?php include("main_content.php"); ?>');
  • Robx
    Confirmed User
    • Nov 2004
    • 357

    #2
    Your include statement is correct. But without seeing the start of your code, it's tough to see where you're going wrong.

    Contact Us About Getting Your Paysites Exposed To Millions Of People On The Peer To Peer Networks!
    ICQ 124-249-781

    Comment

    • Jace
      FBOP Class Of 2013
      • Jan 2004
      • 35562

      #3
      here is the entire page

      Code:
      <?php
      /*
        $Id: index.php,v 1.1 2003/06/11 17:38:00 hpdl Exp $
      
        osCommerce, Open Source E-Commerce Solutions
        http://www.oscommerce.com
      
        Copyright (c) 2003 osCommerce
      
        Released under the GNU General Public License
      */
      
      define('TEXT_MAIN', '' . tep_image(DIR_WS_IMAGES . 'default/greeting.jpg') . '<hr width="375" size="1" color="#000000"><br><?php include("main_content.php"); ?>');
      define('TABLE_HEADING_NEW_PRODUCTS', 'New Products For %s');
      define('TABLE_HEADING_UPCOMING_PRODUCTS', 'Upcoming Products');
      define('TABLE_HEADING_DATE_EXPECTED', 'Date Expected');
      
      if ( ($category_depth hahahaha 'products') || (isset($HTTP_GET_VARS['manufacturers_id'])) ) {
        define('HEADING_TITLE', '');
        define('TABLE_HEADING_IMAGE', '');
        define('TABLE_HEADING_MODEL', 'Model');
        define('TABLE_HEADING_PRODUCTS', 'Product Name');
        define('TABLE_HEADING_MANUFACTURER', 'Manufacturer');
        define('TABLE_HEADING_QUANTITY', 'Quantity');
        define('TABLE_HEADING_PRICE', 'Price');
        define('TABLE_HEADING_WEIGHT', 'Weight');
        define('TABLE_HEADING_BUY_NOW', 'Buy Now');
        define('TEXT_NO_PRODUCTS', 'Sorry, there there is nothing here yet!.');
        define('TEXT_NO_PRODUCTS2', 'There is no product available from this manufacturer.');
        define('TEXT_NUMBER_OF_PRODUCTS', 'Number of Products: ');
        define('TEXT_SHOW', '<b>Show:</b>');
        define('TEXT_BUY', 'Buy 1 \'');
        define('TEXT_NOW', '\' now');
        define('TEXT_ALL_CATEGORIES', 'All Categories');
        define('TEXT_ALL_MANUFACTURERS', 'All Manufacturers');
      } elseif ($category_depth hahahaha 'top') {
        define('HEADING_TITLE', '');
      } elseif ($category_depth hahahaha 'nested') {
        define('HEADING_TITLE', 'Categories');
      }
      ?>

      Comment

      • Azlord
        Confirmed User
        • Dec 2003
        • 2651

        #4
        it doesn't look like your include is wrong. Either some code before it is incorrect or some code on the php page you are trying to include is fucked.

        Comment

        • Jace
          FBOP Class Of 2013
          • Jan 2004
          • 35562

          #5
          and it is just showing up like this

          http://www.ecstasyglass.com/

          and I need this http://www.ecstasyglass.com/main_content.php to be included in the part I have added it to in the code

          Comment

          • Azlord
            Confirmed User
            • Dec 2003
            • 2651

            #6
            Hey Jace...
            I don't see where this is outputting anything. It looks like this is just defining shit. I don't know forsure though.
            What I would do is add the include after the end of the if() loop.

            Comment

            • Serge Litehead
              Confirmed User
              • Dec 2002
              • 5190

              #7
              Your code:
              define('TEXT_MAIN', '' . tep_image(DIR_WS_IMAGES . 'default/greeting.jpg') . '<hr width="375" size="1" color="#000000"><br><?php include("main_content.php"); ?>');

              Try this instead:
              define('TEXT_MAIN', '' . tep_image(DIR_WS_IMAGES . 'default/greeting.jpg') . '<hr width="375" size="1" color="#000000"><br>'.include("main_content.php")) ;

              Comment

              • Serge Litehead
                Confirmed User
                • Dec 2002
                • 5190

                #8
                you can't have "<?php" tags nested within each other.

                the include() function should be applied the same way as tep_image() there with concatenation periods around it .include().

                simple example:
                $var = "Hi my name " . get_name() . " whats up?";
                or
                $var = "Hi my name " . get_name();

                Comment

                • Azlord
                  Confirmed User
                  • Dec 2003
                  • 2651

                  #9
                  yah getting rid of the <?php
                  may help since it's already in a <? tag from the top

                  Comment

                  • Jace
                    FBOP Class Of 2013
                    • Jan 2004
                    • 35562

                    #10
                    trying now

                    Comment

                    • Jace
                      FBOP Class Of 2013
                      • Jan 2004
                      • 35562

                      #11
                      Originally posted by holograph
                      you can't have "<?php" tags nested within each other.

                      the include() function should be applied the same way as tep_image() there with concatenation periods around it .include().

                      simple example:
                      $var = "Hi my name " . get_name() . " whats up?";
                      or
                      $var = "Hi my name " . get_name();
                      ok, so it should be

                      . tep_include('main_content.php') .

                      ?

                      Comment

                      • Serge Litehead
                        Confirmed User
                        • Dec 2002
                        • 5190

                        #12
                        Originally posted by JaceXXX
                        ok, so it should be

                        . tep_include('main_content.php') .

                        ?
                        no, sorry for the confusion, here is the correct line:
                        define('TEXT_MAIN', '' . tep_image(DIR_WS_IMAGES . 'default/greeting.jpg') . '<hr width="375" size="1" color="#000000"><br>'.include("main_content.php")) ;

                        Comment

                        • Jace
                          FBOP Class Of 2013
                          • Jan 2004
                          • 35562

                          #13
                          Originally posted by holograph
                          Your code:
                          define('TEXT_MAIN', '' . tep_image(DIR_WS_IMAGES . 'default/greeting.jpg') . '<hr width="375" size="1" color="#000000"><br><?php include("main_content.php"); ?>');

                          Try this instead:
                          define('TEXT_MAIN', '' . tep_image(DIR_WS_IMAGES . 'default/greeting.jpg') . '<hr width="375" size="1" color="#000000"><br>'.include("main_content.php")) ;
                          all that did was make the entire www.ecstasyglass.com show up as the main_content.php

                          Comment

                          • Serge Litehead
                            Confirmed User
                            • Dec 2002
                            • 5190

                            #14
                            where do you want include main_content.php, as part of define('TEXT_MAIN' ... ?

                            Comment

                            • Serge Litehead
                              Confirmed User
                              • Dec 2002
                              • 5190

                              #15
                              Originally posted by holograph
                              where do you want include main_content.php, as part of define('TEXT_MAIN' ... ?
                              does main_content.php have any print or echo functions in there?

                              Comment

                              • Jace
                                FBOP Class Of 2013
                                • Jan 2004
                                • 35562

                                #16
                                Originally posted by holograph
                                does main_content.php have any print or echo functions in there?

                                nope, it is straight html

                                Comment

                                • Jace
                                  FBOP Class Of 2013
                                  • Jan 2004
                                  • 35562

                                  #17
                                  i just basically want that index.php page to call main_content.php and it show up in the text_main

                                  Comment

                                  Working...