Php question - simple shit...

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

    #1

    Php question - simple shit...

    i need to insert an image into this page, and I know little about php

    why when I put this in
    <img src='images/CategoriesBox/header.jpg' width='150' height='15' border='0'>

    does it give me a

    Parse error: parse error, unexpected '<'

    error?

    how can I write that in php so the image shows up?
  • newbreed
    Confirmed User
    • Nov 2003
    • 9898

    #2
    Don't you need another " ' " before your last " ?

    Loryn ‎(3:16 PM):
    I love it, just as long as we keep the bedroom door closed from all ears then we can have throw down hard core sex that makes us money haha
    fuck it we can have sex on money never did that before

    Comment

    • newbreed
      Confirmed User
      • Nov 2003
      • 9898

      #3
      Nevermind, I may be wrong on that.

      What script are you trying to play with?

      Loryn ‎(3:16 PM):
      I love it, just as long as we keep the bedroom door closed from all ears then we can have throw down hard core sex that makes us money haha
      fuck it we can have sex on money never did that before

      Comment

      • Jace
        FBOP Class Of 2013
        • Jan 2004
        • 35562

        #4
        Originally posted by newbreed
        Don't you need another " ' " before your last " ?
        there are no " in there, that fucks it all up, i have to use '

        the code works fine outside the <?php tag, but within it parsese it wrong

        Comment

        • Jace
          FBOP Class Of 2013
          • Jan 2004
          • 35562

          #5
          Originally posted by newbreed
          Nevermind, I may be wrong on that.

          What script are you trying to play with?
          oscommerce...customizing it....trying graphical infobox headers for the first time

          Comment

          • broke
            Confirmed User
            • Aug 2003
            • 4501

            #6
            Paste more of the code... I think it's carry over from the line above.

            echo "<img src='images/CategoriesBox/header.jpg' width='150' height='15' border='0'>";

            Should work just fine.
            Last edited by broke; 05-11-2005, 11:04 PM.
            Perfect Gonzo

            Comment

            • newbreed
              Confirmed User
              • Nov 2003
              • 9898

              #7
              Originally posted by JaceXXX
              there are no " in there, that fucks it all up, i have to use '

              the code works fine outside the <?php tag, but within it parsese it wrong

              Paste the whole php tag

              Loryn ‎(3:16 PM):
              I love it, just as long as we keep the bedroom door closed from all ears then we can have throw down hard core sex that makes us money haha
              fuck it we can have sex on money never did that before

              Comment

              • Jace
                FBOP Class Of 2013
                • Jan 2004
                • 35562

                #8
                Code:
                <!-- categories //-->
                          <tr>
                            <td>
                <?php
                <img src='images/CategoriesBox/header.jpg' width='150' height='15' border='0'>
                  $categories_string = '';
                
                  $categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '0' and c.categories_id = cd.categories_id and cd.language_id='" . $languages_id ."' order by sort_order, cd.categories_name");
                  while ($categories = tep_db_fetch_array($categories_query))  {
                    $foo[$categories['categories_id']] = array(
                                                        'name' => $categories['categories_name'],
                                                        'parent' => $categories['parent_id'],
                                                        'level' => 0,
                                                        'path' => $categories['categories_id'],
                                                        'next_id' => false
                                                       );
                
                    if (isset($prev_id)) {
                      $foo[$prev_id]['next_id'] = $categories['categories_id'];
                    }
                
                    $prev_id = $categories['categories_id'];
                
                    if (!isset($first_element)) {
                      $first_element = $categories['categories_id'];
                    }
                  }
                i wanna insert an image at the very top of it all, but within the php code so there is no gap between where the php starts and the html ends

                Comment

                • newbreed
                  Confirmed User
                  • Nov 2003
                  • 9898

                  #9
                  Originally posted by JaceXXX
                  oscommerce...customizing it....trying graphical infobox headers for the first time

                  Dude I am all over that shit, hit me up 346940591

                  Loryn ‎(3:16 PM):
                  I love it, just as long as we keep the bedroom door closed from all ears then we can have throw down hard core sex that makes us money haha
                  fuck it we can have sex on money never did that before

                  Comment

                  • newbreed
                    Confirmed User
                    • Nov 2003
                    • 9898

                    #10
                    Like this?

                    http://www.newbreedmedia.com/rare/catalog/

                    Loryn ‎(3:16 PM):
                    I love it, just as long as we keep the bedroom door closed from all ears then we can have throw down hard core sex that makes us money haha
                    fuck it we can have sex on money never did that before

                    Comment

                    • broke
                      Confirmed User
                      • Aug 2003
                      • 4501

                      #11
                      Use:

                      Code:
                      <!-- categories //-->
                                <tr>
                                  <td>
                      <?php
                        [b]echo "<img src='images/CategoriesBox/header.jpg' width='150' height='15' border='0'>";[/b]
                        $categories_string = '';
                      
                        $categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '0' and c.categories_id = cd.categories_id and cd.language_id='" . $languages_id ."' order by sort_order, cd.categories_name");
                        while ($categories = tep_db_fetch_array($categories_query))  {
                          $foo[$categories['categories_id']] = array(
                                                              'name' => $categories['categories_name'],
                                                              'parent' => $categories['parent_id'],
                                                              'level' => 0,
                                                              'path' => $categories['categories_id'],
                                                              'next_id' => false
                                                             );
                      
                          if (isset($prev_id)) {
                            $foo[$prev_id]['next_id'] = $categories['categories_id'];
                          }
                      
                          $prev_id = $categories['categories_id'];
                      
                          if (!isset($first_element)) {
                            $first_element = $categories['categories_id'];
                          }
                        }
                      Perfect Gonzo

                      Comment

                      • Jace
                        FBOP Class Of 2013
                        • Jan 2004
                        • 35562

                        #12
                        Originally posted by broke
                        Paste more of the code... I think it's carry over from the line above.

                        echo "<img src='images/CategoriesBox/header.jpg' width='150' height='15' border='0'>";

                        Should work just fine.
                        that was it, thanks so much

                        Comment

                        • Jace
                          FBOP Class Of 2013
                          • Jan 2004
                          • 35562

                          #13
                          Originally posted by newbreed
                          yeah

                          i have done oscommerce before, but just never played with graphical headers for the infobox....i am gunna make this design so dope...LOL

                          wish I could show you all, but it is kind of secret right now

                          Comment

                          • newbreed
                            Confirmed User
                            • Nov 2003
                            • 9898

                            #14
                            Originally posted by JaceXXX
                            Code:
                            <!-- categories //-->
                                      <tr>
                                        <td>
                            <?php
                            <img src='images/CategoriesBox/header.jpg' width='150' height='15' border='0'>
                              $categories_string = '';
                            
                              $categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '0' and c.categories_id = cd.categories_id and cd.language_id='" . $languages_id ."' order by sort_order, cd.categories_name");
                              while ($categories = tep_db_fetch_array($categories_query))  {
                                $foo[$categories['categories_id']] = array(
                                                                    'name' => $categories['categories_name'],
                                                                    'parent' => $categories['parent_id'],
                                                                    'level' => 0,
                                                                    'path' => $categories['categories_id'],
                                                                    'next_id' => false
                                                                   );
                            
                                if (isset($prev_id)) {
                                  $foo[$prev_id]['next_id'] = $categories['categories_id'];
                                }
                            
                                $prev_id = $categories['categories_id'];
                            
                                if (!isset($first_element)) {
                                  $first_element = $categories['categories_id'];
                                }
                              }
                            i wanna insert an image at the very top of it all, but within the php code so there is no gap between where the php starts and the html ends
                            Gotcha, see the post above, he nailed it. I thought you meant the table headers.

                            Loryn ‎(3:16 PM):
                            I love it, just as long as we keep the bedroom door closed from all ears then we can have throw down hard core sex that makes us money haha
                            fuck it we can have sex on money never did that before

                            Comment

                            • V_RocKs
                              Damn Right I Kiss Ass!
                              • Nov 2003
                              • 32449

                              #15
                              Damn... wow.... I'm just gonna keep my mouth shut.. ;)

                              Comment

                              • Damian_Maxcash
                                So Fucking Banned
                                • Oct 2002
                                • 12745

                                #16
                                Originally posted by JaceXXX
                                that was it, thanks so much
                                If you use any HTML in a PHP tag it has to be with an 'echo'

                                I would guess that it would be better practice to just put the image in before the PHP tag, but unless you talking about millions of hits I doubt it would make a difference.

                                Comment

                                • Jace
                                  FBOP Class Of 2013
                                  • Jan 2004
                                  • 35562

                                  #17
                                  Originally posted by damian2001
                                  If you use any HTML in a PHP tag it has to be with an 'echo'

                                  I would guess that it would be better practice to just put the image in before the PHP tag, but unless you talking about millions of hits I doubt it would make a difference.
                                  when i put the html before the php tag it creates a gap between the image and php...and it needs to be seemless

                                  Comment

                                  • Jace
                                    FBOP Class Of 2013
                                    • Jan 2004
                                    • 35562

                                    #18
                                    Originally posted by V_RocKs
                                    Damn... wow.... I'm just gonna keep my mouth shut.. ;)
                                    about what? actual knowledge being shared on gfy? LOL

                                    i am a graphics guy who happens to know extensive html and basic coding i hire people to do my work! haha

                                    Comment

                                    Working...