MIME type??

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
batt
Forum Newbie
Posts: 5
Joined: Fri Dec 11, 2009 5:10 am

MIME type??

Post by batt »

Hello I'm having problems with a broken banner (identifies as text/html) when i ammend to make it recognise as right MIME type (by removing the closing /):

Code: Select all

 
<td width="569" valign=top><img src="../images/showcase.jpg" width="569" height="222" /></td>
the banner displays but the .gifs above fail. In fact the .gifs fail if i make any ammendments at all.
edit: i meant the .gifs above it in code.

site: http://www.battsails.com/store_1

here is the whole header.php

Code: Select all

<?php
/*
USERCART
 
http://www.usercart.com
 
Copyright (c) All right are reserved 2008 USERCART
 
email@usercart.com
*/
 
// check if the 'install' directory exists, and warn of its existence
  if (WARN_INSTALL_EXISTENCE == 'false') {
    if (file_exists(dirname($HTTP_SERVER_VARS['SCRIPT_FILENAME']) . '/install')) {
      $messageStack->add('header', WARNING_INSTALL_DIRECTORY_EXISTS, 'warning');
    }
  }
 
// check if the configure.php file is writeable
  if (WARN_CONFIG_WRITEABLE == 'false') {
    if ( (file_exists(dirname($HTTP_SERVER_VARS['SCRIPT_FILENAME']) . '/includes/configure.php')) && (is_writeable(dirname($HTTP_SERVER_VARS['SCRIPT_FILENAME']) . '/includes/configure.php')) ) {
      $messageStack->add('header', WARNING_CONFIG_FILE_WRITEABLE, 'warning');
    }
  }
 
// check if the session folder is writeable
  if (WARN_SESSION_DIRECTORY_NOT_WRITEABLE == 'true') {
    if (STORE_SESSIONS == '') {
      if (!is_dir(tep_session_save_path())) {
        $messageStack->add('header', WARNING_SESSION_DIRECTORY_NON_EXISTENT, 'warning');
      } elseif (!is_writeable(tep_session_save_path())) {
        $messageStack->add('header', WARNING_SESSION_DIRECTORY_NOT_WRITEABLE, 'warning');
      }
    }
  }
 
// check session.auto_start is disabled
  if ( (function_exists('ini_get')) && (WARN_SESSION_AUTO_START == 'true') ) {
    if (ini_get('session.auto_start') == '1') {
      $messageStack->add('header', WARNING_SESSION_AUTO_START, 'warning');
    }
  }
 
  if ( (WARN_DOWNLOAD_DIRECTORY_NOT_READABLE == 'true') && (DOWNLOAD_ENABLED == 'true') ) {
    if (!is_dir(DIR_FS_DOWNLOAD)) {
      $messageStack->add('header', WARNING_DOWNLOAD_DIRECTORY_NON_EXISTENT, 'warning');
    }
  }
 
  if ($messageStack->size('header') > 0) {
    echo $messageStack->output('header');
  }
?>
<style type="text/css">
<!--
.cuur {
    font-size: 12px;
    font-weight: bold;
    font-family: Tahoma;
    color: #FF0000;
}
-->
</style>
<script language="JavaScript" src="https://secure.comodo.net/trustlogo/javascript/trustlogo.js" type="text/javascript">
</script>
 
 
 <script type="text/javascript">
<!--
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
 
function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}
 
function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->
</script>
<body onLoad="MM_preloadImages('images/shippingicon.jpg')"><table cellspacing=0 cellpadding=0 width=736 align=center>
<tr><td><table cellspacing=0 cellpadding=0>
         
         <tr><td width="766" height="70" bgcolor="#FFFFFF"><div align="right"><img src="images/long_logo.gif" width="750" height="109" /></div></td>
          </tr>
        </table>
 <table cellspacing=0 cellpadding=0>
         <tr><td width=201 valign=top>
         <table cellspacing=0 cellpadding=0>
            <tr><td width="199"><img src=images/m07.gif width=199 height=13></td>
            </tr>               
               <tr><td><div align="center"><a href=<?=tep_href_link('index.php')?>><img src=images/tab01.gif width=165 height=38 border=0></a></div></td>
               </tr>
               <tr><td><div align="center"><a href=<?=tep_href_link('products_new.php')?>><img src=images/tab02.gif width=165 height=38 border=0></a></div></td>
               </tr>
               <tr><td><div align="center"><a href=<?=tep_href_link('account.php')?>><img src=images/tab03.gif width=165 height=38 border=0></a></div></td>
               </tr>
               <tr><td><div align="center"><a href=<?=tep_href_link('shopping_cart.php')?>><img src=images/tab04.gif width=165 height=38 border=0></a></div></td>
               </tr>
               <tr><td><div align="center"><a href=<?=tep_href_link('checkout_shipping.php')?>><img src=images/tab05.gif width=165 height=38 border=0></a></div></td>
               </tr>                              
               <tr><td><img src=images/m15.gif width=199 height=18></td></tr>
              </table>
             </td>
             <td width="569" valign=top><img src="../images/showcase.jpg" width="569" height="222" /></td>
<td width="10">
       <table cellspacing=0 cellpadding=0 height=164 border=0>
               <tr><td>&nbsp;</td>
               </tr>
               <tr><td class=bg>&nbsp;</td>
               </tr>
               <tr><td>&nbsp;</td>
               </tr>
              </table>
         </td></tr>
        </table>
        <table cellspacing=0 cellpadding=0>
         <tr><td colspan=3 height=3><!--
TrustLogo Html Builder Code:
Shows the logo at URL 
Logo type is  ("SCCC")
Not Floating
//-->
<a href="http://www.instantssl.com" id="comodoTL">SSL</a>
<script type="text/javascript">TrustLogo("", "SCCC", "none");</script></td></tr>
         <tr><td width=207 valign=top>
              <table cellspacing=0 cellpadding=0>
               <tr><td><img src=images/m24.gif width=207 height=40></td></tr>
               <tr><td class=bg1>
                    <table cellspacing=0 cellpadding=0 width=167 align=center>
                     <tr><td height=18></td></tr>
 
<?   // ---- CATEGORIES
 
  function tep_show_category($counter) {
    global $tree, $categories_string, $cPath_array;
 
   if(!$tree[$counter]['level']){
                     
                     
    $categories_string .= $categories_string ? '<tr><td><img src=images/m26.gif width=167 height=1><br><br class=px2></td></tr>' : '';             
 
    $categories_string .= '<tr><td><img src=images/m25.gif width=5 height=5 align=absmiddle> &nbsp; <a class=ml1 href=';
    
    if ($tree[$counter]['parent'] == 0) {
      $cPath_new = 'cPath=' . $counter;
    } else {
      $cPath_new = 'cPath=' . $tree[$counter]['path'];
    }
    $categories_string .= tep_href_link('index.php', $cPath_new) . '>';
// display category name
    $categories_string .= $tree[$counter]['name'];
    $categories_string .= '</a><br><br class=px4></td></tr>';
   }else{
    $categories_string .= '<tr><td>';
 
    for($i=0;$i<$tree[$counter]['level'];$i++)
     $categories_string .= '&nbsp;&nbsp;&nbsp;';
    
    $categories_string .= ' - <a class=ml1 href=';   
    if ($tree[$counter]['parent'] == 0) {
      $cPath_new = 'cPath=' . $counter;
    } else {
      $cPath_new = 'cPath=' . $tree[$counter]['path'];
    }
    $categories_string .= tep_href_link('index.php', $cPath_new) . '>';
// display category name
    $categories_string .= $tree[$counter]['name'];
    $categories_string .= '</a><br><br class=px4></td></tr>';
   }  
 
    if ($tree[$counter]['next_id'] != false) {
      tep_show_category($tree[$counter]['next_id']);
    }  
  }
 
 
 
  define(TABLE_CATEGORIES, "categories");
  define(TABLE_CATEGORIES_DESCRIPTION, "categories_description");
  $categories_string = '';
  $tree = array();
 
  $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='" . (int)$languages_id ."' order by sort_order, cd.categories_name");
  while ($categories = tep_db_fetch_array($categories_query))  {
    $tree[$categories['categories_id']] = array('name' => $categories['categories_name'],
                                                'parent' => $categories['parent_id'],
                                                'level' => 0,
                                                'path' => $categories['categories_id'],
                                                'next_id' => false);
 
    if (isset($parent_id)) {
      $tree[$parent_id]['next_id'] = $categories['categories_id'];
    }
 
    $parent_id = $categories['categories_id'];
 
    if (!isset($first_element)) {
      $first_element = $categories['categories_id'];
    }
  }
 
  //------------------------
  if ($cPath) {
    $new_path = '';
    reset($cPath_array);
    while (list($key, $value) = each($cPath_array)) {
      unset($parent_id);
      unset($first_id);
      $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 = '" . (int)$value . "' and c.categories_id = cd.categories_id and cd.language_id='" . (int)$languages_id ."' order by sort_order, cd.categories_name");
      if (tep_db_num_rows($categories_query)) {
        $new_path .= $value;
        while ($row = tep_db_fetch_array($categories_query)) {
          $tree[$row['categories_id']] = array('name' => $row['categories_name'],
                                               'parent' => $row['parent_id'],
                                               'level' => $key+1,
                                               'path' => $new_path . '_' . $row['categories_id'],
                                               'next_id' => false);
 
          if (isset($parent_id)) {
            $tree[$parent_id]['next_id'] = $row['categories_id'];
          }
 
          $parent_id = $row['categories_id'];
 
          if (!isset($first_id)) {
            $first_id = $row['categories_id'];
          }
 
          $last_id = $row['categories_id'];
        }
        $tree[$last_id]['next_id'] = $tree[$value]['next_id'];
        $tree[$value]['next_id'] = $first_id;
        $new_path .= '_';
      } else {
        break;
      }
    }
  }
  $categories_string .=  '';
  tep_show_category($first_element); 
  $categories_string .=  '';
 
  echo $categories_string;
?>
                     <tr><td height=5></td></tr>                    
                    </table>
               </td></tr>
               <tr><td><img src=images/m27.gif width=207 height=6></td></tr>
               <tr><td height=3></td></tr>
              </table>
              <div align="left">
              
                <table border="0">
                  <tr>
                    <td><div align="center"><a href="delivery.php" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image15','','images/shippingicon.jpg',1)"><img src="images/shippingicon.jpg" name="Image15" border="0" id="Image15" /></a></div></td>
                  </tr>
                  <tr>
                    <td><div align="center"><img src="images/30days.jpg" width="98" height="98" /></div></td>
                  </tr>
                </table>
               
              </div>
     <table cellspacing=0 cellpadding=0>
               <tr><td><img src=images/m28.gif width=207 height=40></td></tr>
               <tr><td class=bg1>
                    <table cellspacing=0 cellpadding=0 width=175 align=center border=0>
 
                    <?
                     echo tep_draw_form('quick_find', tep_href_link(FILENAME_ADVANCED_SEARCH_RESULT, '', 'NONSSL', false), 'get');
 
               echo '<tr><td height=17 colspan=2></td></tr>
                     <tr><td valign=top align=right>'.tep_draw_input_field('keywords', '', 'size="20" maxlength="30" class=go') . '&nbsp;' . tep_hide_session_id() . '</td><td valign=top align=left>&nbsp;<input type=image src=images/m30.gif width=31 height=21></td></tr>
                     <tr><td height=8 colspan=2></td></tr>
                     <tr><td colspan=2><a class=ml2 href="' . tep_href_link(FILENAME_ADVANCED_SEARCH) . '">' . BOX_SEARCH_ADVANCED_SEARCH . '</a></td></tr>
                     <tr><td height=8 colspan=2></td></tr>
                    </form>';
                    ?>
                     
                    </table>
               </td></tr>
               <tr><td><img src=images/m27.gif width=207 height=6></td></tr>
              </table>
             </td>
             <td width=3 valign=top></td>
             <td width=526 valign=top>
Last edited by batt on Fri Dec 11, 2009 2:17 pm, edited 1 time in total.
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: MIME type??

Post by Christopher »

You said that the GIFs above fail, but the image in your example is a JPG?
(#10850)
batt
Forum Newbie
Posts: 5
Joined: Fri Dec 11, 2009 5:10 am

Re: MIME type??

Post by batt »

This is true. The subbanner is a .jpg and the buttons/heading banner etc. are .gif

even if i change the .jpg to a .gif they all fail.

edit: i meant the .gifs above it in code.
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: MIME type??

Post by requinix »

I get a 404 for that one JPEG image. Everything else seems fine.
batt
Forum Newbie
Posts: 5
Joined: Fri Dec 11, 2009 5:10 am

Re: MIME type??

Post by batt »

when i remove the '/' the banner works, but the .gifs fail.
User avatar
McInfo
DevNet Resident
Posts: 1532
Joined: Wed Apr 01, 2009 1:31 pm

Re: MIME type??

Post by McInfo »

A big problem is the lack of quotes around HTML element attributes.

Incorrect:

Code: Select all

<img src=images/m07.gif width=199 height=13>
Correct:

Code: Select all

<img src="images/m07.gif" width="199" height="13" alt="">
W3C Markup Validation Service: http://www.battsails.com/store_1/

Edit: This post was recovered from search engine cache.
Last edited by McInfo on Thu Jun 17, 2010 3:35 pm, edited 1 time in total.
batt
Forum Newbie
Posts: 5
Joined: Fri Dec 11, 2009 5:10 am

Re: MIME type??

Post by batt »

see what happens?

http://www.battsails.com/store_1/

i dont think the quotes are the issue....
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: MIME type??

Post by requinix »

Code: Select all

<img src="PHP:CSS%20BACKUPS/images/long_logo.gif" width="750" height="109" />
batt
Forum Newbie
Posts: 5
Joined: Fri Dec 11, 2009 5:10 am

Re: MIME type??

Post by batt »

I dont think that was it
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: MIME type??

Post by requinix »

batt wrote:I dont think that was it
Does "PHP:CSS%20BACKUPS/images/long_logo.gif" look like the right URL for the image? Doesn't look right to me.
User avatar
McInfo
DevNet Resident
Posts: 1532
Joined: Wed Apr 01, 2009 1:31 pm

Re: MIME type??

Post by McInfo »

Does not exist:
../images/showcase.jpg
Does exist:
./images/showcase.jpg
images/showcase.jpg
Edit: This post was recovered from search engine cache.
Post Reply