Pictures won't appear right in IE7 but will in Firefox!! :(

Discussion in 'PHP' started by cicciohofman, Aug 3, 2007.

  1. #1
    Hello everyone, I am new to the forum and I got a question

    I am a n00b at PHP but i am learning fast. I am in the process of writing some backend applications for a Photographer. I wrote some code to upload pictures to the database and then to display them to the Administrator. The code tells it to display a certain size.

    It works great in Firefox but in IE7 it just gives me a sliver of the image and it is really ticking me off.

    Please if anyone has some suggestions let me know

    If it would help to include the code let me know

    On second thought, here it is:

    <h1><?php echo $category->getName().' Pictures' ?></h1>
    <br/>
    <?php use_helper('Object') ?>
    
    <?php echo form_tag('category/upload',array('multipart' => true)) ?>
    
    <?php echo object_input_hidden_tag($category, 'getCategoryId') ?>
    
    <?php echo input_file_tag('image') ?>&nbsp;
    
    <?php echo submit_tag('Upload Picture') ?>
    &nbsp;
    <?php echo link_to('Back', 'category/list?category_id='.$category->getCategoryId()) ?><br/><br/>
    
    <?php foreach ($category->getPictures() as $picture): ?>
    
    <?php echo image_tag('../uploads/' . $picture->getLocation(), 'size=300x?') ?>
    
    <?php echo link_to('Delete Picture', 'category/deletePicture?picture_id='.$picture->getPictureId()) ?><br/><br/>
    
    <?php endforeach; ?>
    <br/>
    <?php echo link_to('Back to Main', 'site/index') ?>
    PHP:
     
    cicciohofman, Aug 3, 2007 IP
  2. fatinfo guy

    fatinfo guy Peon

    Messages:
    586
    Likes Received:
    34
    Best Answers:
    0
    Trophy Points:
    0
    #2
    If would be more helpful if you can output the HTML, because we don't know what the PHP is rendering for display.
     
    fatinfo guy, Aug 3, 2007 IP
  3. cicciohofman

    cicciohofman Peon

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    This is the stuff that came up when I clicked view source in IE7


    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    <head>
    <base href="http://hofman.tboxsoftware.com/photo/web/" />
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="title" content="JHofman Photography Admin" />
    <meta name="robots" content="index, follow" />
    <meta name="description" content="symfony project" />
    <meta name="keywords" content="symfony, project" />
    <meta name="language" content="en" />
    
    <title>JHofman Photography Admin</title>
    
    <link rel="shortcut icon" href="/favicon.ico" />
    
    <script type="text/javascript" src="/photo/web/sf/sf_web_debug/js/main.js"></script>
    <link rel="stylesheet" type="text/css" media="screen" href="/photo/web/sf/sf_web_debug/css/main.css" />
    <link rel="stylesheet" type="text/css" media="screen" href="/photo/web/css/adminStyles.css" />
    </head>
    <body>
    <a href="http://www.jhofmanphotography.com"><img src="images/L_camera.png" alt="JHofman Photography" class="L_cameraImage"/></a>
    
    <div class="L_headerBarDiv">
    	<div><img src="images/L_header_leftCorner.png" width="5" height="42" /></div>
    	<div class="L_headerMenu">
    		<div class="L_headerName">JHofman Photography</div>
    	</div>
    	<div><img src="images/L_header_rightCorner.png" width="6" height="42" /></div>
    </div>
    <span id="icon_bar">
    	<a href="/photo/web/backend_dev.php/category/list"><img alt="Portfolio" align="left" src="/photo/web/images/icons/pictures_S.png" /><span>Portfolio</span></a>	<a href="/photo/web/backend_dev.php/site/edit"><img alt="Admin Preferences" align="left" src="/photo/web/images/icons/documents_S.png" /><span>Admin Preferences</span></a>	<a href="/photo/web/backend_dev.php/site/logout"><img alt="Logout" align="right" src="/photo/web/images/logout.gif" /></a></span>
    <div style="clear:both"><img src="images/spacer.gif" /></div>
    <div class="L_contentTopDiv"><img src="images/spacer.gif" /></div>
    <div class="L_contentMiddleDiv">
    <h1>Wedding Pictures</h1>
    <br/>
    
    <form method="post" enctype="multipart/form-data" action="/photo/web/backend_dev.php/category/upload">
    <input type="hidden" name="category_id" id="category_id" value="1" />
    <input type="file" name="image" id="image" value="" />&nbsp;
    
    <input type="submit" name="commit" value="Upload Picture" />&nbsp;
    <a href="/photo/web/backend_dev.php/category/list/category_id/1">Back</a><br/><br/>
    
    
    <img src="/photo/web/images/../uploads/1185833662.jpg" alt="1185833662" height="?" width="300" />
    <a href="/photo/web/backend_dev.php/category/deletePicture/picture_id/9">Delete Picture</a><br/><br/>
    
    
    <img src="/photo/web/images/../uploads/1185833670.jpg" alt="1185833670" height="?" width="300" />
    <a href="/photo/web/backend_dev.php/category/deletePicture/picture_id/10">Delete Picture</a><br/><br/>
    
    
    <img src="/photo/web/images/../uploads/1186159378.jpg" alt="1186159378" height="?" width="300" />
    <a href="/photo/web/backend_dev.php/category/deletePicture/picture_id/15">Delete Picture</a><br/><br/>
    
    <br/>
    <a href="/photo/web/backend_dev.php/">Back to Main</a><div style="margin-left: 20px; margin-right: 20px; text-align: center;"><hr style="clear: both;" />Copyright 2007 <a href="http://www.jhofmanphotography.com">JHofman Photography</a></div>
    </div>
    </div>
    <div class="L_contentBottomDiv"><img src="images/spacer.gif" /></div>
    
    <div>
    
        <div id="sfWebDebug">
          <div id="sfWebDebugBar" class="sfWebDebugWarning">
            <a href="#" onclick="sfWebDebugToggleMenu(); return false;"><img src="/photo/web/sf/sf_web_debug/images/sf.png" alt="Sf" /></a>
            <ul id="sfWebDebugDetails" class="menu">
              <li>1.0.3</li>
              <li><a href="#" onclick="sfWebDebugShowDetailsFor('sfWebDebugConfig'); return false;"><img src="/photo/web/sf/sf_web_debug/images/config.png" alt="Config" /> vars &amp; config</a></li>
              
              <li><a href="#" onclick="sfWebDebugShowDetailsFor('sfWebDebugLog'); return false;"><img src="/photo/web/sf/sf_web_debug/images/comment.png" alt="Comment" /> logs &amp; msgs</a></li>
              <li><a href="#" onclick="sfWebDebugShowDetailsFor('sfWebDebugDatabaseDetails'); return false;"><img src="/photo/web/sf/sf_web_debug/images/database.png" alt="Database" /> 2</a></li>
              <li><img src="/photo/web/sf/sf_web_debug/images/memory.png" alt="Memory" /> 3887.7 KB</li>
              <li class="last"><a href="#" onclick="sfWebDebugShowDetailsFor('sfWebDebugTimeDetails'); return false;"><img src="/photo/web/sf/sf_web_debug/images/time.png" alt="Time" /> 528 ms</a></li>
            </ul>
            <a href="#" onclick="document.getElementById('sfWebDebug').style.display='none'; return false;"><img src="/photo/web/sf/sf_web_debug/images/close.png" alt="Close" /></a>
          </div>
    
          <div id="sfWebDebugLog" class="top" style="display: none"><h1>Log and debug messages</h1>
            <ul id="sfWebDebugLogMenu">
              <li><a href="#" onclick="sfWebDebugToggleAllLogLines(true, 'sfWebDebugLogLine'); return false;">[all]</a></li>
              <li><a href="#" onclick="sfWebDebugToggleAllLogLines(false, 'sfWebDebugLogLine'); return false;">[none]</a></li>
              <li><a href="#" onclick="sfWebDebugShowOnlyLogLines('info'); return false;"><img src="/photo/web/sf/sf_web_debug/images/info.png" alt="Info" /></a></li>
              <li><a href="#" onclick="sfWebDebugShowOnlyLogLines('warning'); return false;"><img src="/photo/web/sf/sf_web_debug/images/warning.png" alt="Warning" /></a></li>
              <li><a href="#" onclick="sfWebDebugShowOnlyLogLines('error'); return false;"><img src="/photo/web/sf/sf_web_debug/images/error.png" alt="Error" /></a></li>
              <li><a href="#" onclick="sfWebDebugToggleMessages('sfAction'); return false;">sfAction</a></li>
    <li><a href="#" onclick="sfWebDebugToggleMessages('sfContext'); return false;">sfContext</a></li>
    <li><a href="#" onclick="sfWebDebugToggleMessages('sfController'); return false;">sfController</a></li>
    <li><a href="#" onclick="sfWebDebugToggleMessages('sfCreole'); return false;">sfCreole</a></li>
    <li><a href="#" onclick="sfWebDebugToggleMessages('sfFilter'); return false;">sfFilter</a></li>
    <li><a href="#" onclick="sfWebDebugToggleMessages('sfPhpConfigHandler'); return false;">sfPhpConfigHandler</a></li>
    <li><a href="#" onclick="sfWebDebugToggleMessages('sfRequest'); return false;">sfRequest</a></li>
    <li><a href="#" onclick="sfWebDebugToggleMessages('sfRouting'); return false;">sfRouting</a></li>
    <li><a href="#" onclick="sfWebDebugToggleMessages('sfView'); return false;">sfView</a></li>
            </ul>
            <div id="sfWebDebugLogLines"><table class="sfWebDebugLogs">
            <tr>
              <th>#</th>
              <th>type</th>
              <th>message</th>
            </tr>
    <tr class='sfWebDebugLogLine sfWebDebugWarning sfPhpConfigHandler'><td class="sfWebDebugLogNumber">1</td><td class="sfWebDebugLogType"><img src="/photo/web/sf/sf_web_debug/images/warning.png" alt="Warning" />&nbsp;PhpConfigHandler</td><td>php.ini "<span class="sfWebDebugLogInfo">magic_quotes_gpc</span>" key is better set to "<span class="sfWebDebugLogInfo">false</span>" (current value is "<span class="sfWebDebugLogInfo">'1'</span>" - php.ini location: "<span class="sfWebDebugLogInfo">/etc/php5/apache2/php.ini</span>")</td></tr>
    <tr class='sfWebDebugLogLine sfWebDebugInfo sfContext'><td class="sfWebDebugLogNumber">2</td><td class="sfWebDebugLogType"><img src="/photo/web/sf/sf_web_debug/images/info.png" alt="Info" />&nbsp;Context</td><td>initialization</td></tr>
    <tr class='sfWebDebugLogLine sfWebDebugInfo sfController'><td class="sfWebDebugLogNumber">3</td><td class="sfWebDebugLogType"><img src="/photo/web/sf/sf_web_debug/images/info.png" alt="Info" />&nbsp;Controller</td><td>initialization</td></tr>
    <tr class='sfWebDebugLogLine sfWebDebugInfo sfRouting'><td class="sfWebDebugLogNumber">4</td><td class="sfWebDebugLogType"><img src="/photo/web/sf/sf_web_debug/images/info.png" alt="Info" />&nbsp;Routing</td><td>match route [default] "<span class="sfWebDebugLogInfo">/:module/:action/*</span>"</td></tr>
    <tr class='sfWebDebugLogLine sfWebDebugInfo sfRequest'><td class="sfWebDebugLogNumber">5</td><td class="sfWebDebugLogType"><img src="/photo/web/sf/sf_web_debug/images/info.png" alt="Info" />&nbsp;Request</td><td>request parameters array (  'module' =&gt; 'category',  'action' =&gt; 'picture',  'category_id' =&gt; '1',)</td></tr>
    <tr class='sfWebDebugLogLine sfWebDebugInfo sfController'><td class="sfWebDebugLogNumber">6</td><td class="sfWebDebugLogType"><img src="/photo/web/sf/sf_web_debug/images/info.png" alt="Info" />&nbsp;Controller</td><td>dispatch request</td></tr>
    <tr class='sfWebDebugLogLine sfWebDebugInfo sfFilter'><td class="sfWebDebugLogNumber">7</td><td class="sfWebDebugLogType"><img src="/photo/web/sf/sf_web_debug/images/info.png" alt="Info" />&nbsp;Filter</td><td>executing filter "<span class="sfWebDebugLogInfo">sfRenderingFilter</span>"</td></tr>
    <tr class='sfWebDebugLogLine sfWebDebugInfo sfFilter'><td class="sfWebDebugLogNumber">8</td><td class="sfWebDebugLogType"><img src="/photo/web/sf/sf_web_debug/images/info.png" alt="Info" />&nbsp;Filter</td><td>executing filter "<span class="sfWebDebugLogInfo">sfWebDebugFilter</span>"</td></tr>
    <tr class='sfWebDebugLogLine sfWebDebugInfo sfFilter'><td class="sfWebDebugLogNumber">9</td><td class="sfWebDebugLogType"><img src="/photo/web/sf/sf_web_debug/images/info.png" alt="Info" />&nbsp;Filter</td><td>executing filter "<span class="sfWebDebugLogInfo">sfBasicSecurityFilter</span>"</td></tr>
    <tr class='sfWebDebugLogLine sfWebDebugInfo sfFilter'><td class="sfWebDebugLogNumber">10</td><td class="sfWebDebugLogType"><img src="/photo/web/sf/sf_web_debug/images/info.png" alt="Info" />&nbsp;Filter</td><td>executing filter "<span class="sfWebDebugLogInfo">sfCommonFilter</span>"</td></tr>
    <tr class='sfWebDebugLogLine sfWebDebugInfo sfFilter'><td class="sfWebDebugLogNumber">11</td><td class="sfWebDebugLogType"><img src="/photo/web/sf/sf_web_debug/images/info.png" alt="Info" />&nbsp;Filter</td><td>executing filter "<span class="sfWebDebugLogInfo">sfFlashFilter</span>"</td></tr>
    <tr class='sfWebDebugLogLine sfWebDebugInfo sfFilter'><td class="sfWebDebugLogNumber">12</td><td class="sfWebDebugLogType"><img src="/photo/web/sf/sf_web_debug/images/info.png" alt="Info" />&nbsp;Filter</td><td>executing filter "<span class="sfWebDebugLogInfo">sfExecutionFilter</span>"</td></tr>
    <tr class='sfWebDebugLogLine sfWebDebugInfo sfAction'><td class="sfWebDebugLogNumber">13</td><td class="sfWebDebugLogType"><img src="/photo/web/sf/sf_web_debug/images/info.png" alt="Info" />&nbsp;Action</td><td>call "<span class="sfWebDebugLogInfo">categoryActions-&gt;executePicture()</span>"</td></tr>
    <tr class='sfWebDebugLogLine sfWebDebugInfo sfCreole'><td class="sfWebDebugLogNumber">14</td><td class="sfWebDebugLogType"><img src="/photo/web/sf/sf_web_debug/images/info.png" alt="Info" />&nbsp;Creole</td><td><span class="sfWebDebugLogInfo">connect()</span>: DSN: array (   'database' =&gt; '****',   'encoding' =&gt; '****',   'hostspec' =&gt; '****',   'password' =&gt; '****',   'persistent' =&gt; '****',   'phptype' =&gt; '****',   'port' =&gt; '****',   'protocol' =&gt; '****',   'username' =&gt; '****', ), FLAGS: 0</td></tr>
    <tr class='sfWebDebugLogLine sfWebDebugInfo sfCreole'><td class="sfWebDebugLogNumber">15</td><td class="sfWebDebugLogType"><img src="/photo/web/sf/sf_web_debug/images/info.png" alt="Info" />&nbsp;Creole</td><td><span class="sfWebDebugLogInfo">prepareStatement()</span>: <span class="sfWebDebugLogInfo">SELECT</span> category.CATEGORY_ID, category.NAME, category.PAGE_TITLE, category.META_KEYWORDS, category.META_DESCRIPTION, category.DESCRIPTION <span class="sfWebDebugLogInfo">FROM</span> category <span class="sfWebDebugLogInfo">WHERE</span> category.CATEGORY_ID=?</td></tr>
    <tr class='sfWebDebugLogLine sfWebDebugInfo sfCreole'><td class="sfWebDebugLogNumber">16</td><td class="sfWebDebugLogType"><img src="/photo/web/sf/sf_web_debug/images/info.png" alt="Info" />&nbsp;Creole</td><td><span class="sfWebDebugLogInfo">executeQuery()</span>: [2.67 ms] <span class="sfWebDebugLogInfo">SELECT</span> category.CATEGORY_ID, category.NAME, category.PAGE_TITLE, category.META_KEYWORDS, category.META_DESCRIPTION, category.DESCRIPTION <span class="sfWebDebugLogInfo">FROM</span> category <span class="sfWebDebugLogInfo">WHERE</span> category.CATEGORY_ID=1</td></tr>
    <tr class='sfWebDebugLogLine sfWebDebugInfo sfView'><td class="sfWebDebugLogNumber">17</td><td class="sfWebDebugLogType"><img src="/photo/web/sf/sf_web_debug/images/info.png" alt="Info" />&nbsp;View</td><td>initialize view for "<span class="sfWebDebugLogInfo">category/picture</span>"</td></tr>
    <tr class='sfWebDebugLogLine sfWebDebugInfo sfView'><td class="sfWebDebugLogNumber">18</td><td class="sfWebDebugLogType"><img src="/photo/web/sf/sf_web_debug/images/info.png" alt="Info" />&nbsp;View</td><td>render "<span class="sfWebDebugLogInfo">sf_app_dir/modules/category/templates/pictureSuccess.php</span>"</td></tr>
    <tr class='sfWebDebugLogLine sfWebDebugInfo sfCreole'><td class="sfWebDebugLogNumber">19</td><td class="sfWebDebugLogType"><img src="/photo/web/sf/sf_web_debug/images/info.png" alt="Info" />&nbsp;Creole</td><td><span class="sfWebDebugLogInfo">prepareStatement()</span>: <span class="sfWebDebugLogInfo">SELECT</span> picture.PICTURE_ID, picture.CATEGORY_ID, picture.LOCATION <span class="sfWebDebugLogInfo">FROM</span> picture <span class="sfWebDebugLogInfo">WHERE</span> picture.CATEGORY_ID=?</td></tr>
    <tr class='sfWebDebugLogLine sfWebDebugInfo sfCreole'><td class="sfWebDebugLogNumber">20</td><td class="sfWebDebugLogType"><img src="/photo/web/sf/sf_web_debug/images/info.png" alt="Info" />&nbsp;Creole</td><td><span class="sfWebDebugLogInfo">executeQuery()</span>: [4.35 ms] <span class="sfWebDebugLogInfo">SELECT</span> picture.PICTURE_ID, picture.CATEGORY_ID, picture.LOCATION <span class="sfWebDebugLogInfo">FROM</span> picture <span class="sfWebDebugLogInfo">WHERE</span> picture.CATEGORY_ID=1</td></tr>
    <tr class='sfWebDebugLogLine sfWebDebugInfo sfView'><td class="sfWebDebugLogNumber">21</td><td class="sfWebDebugLogType"><img src="/photo/web/sf/sf_web_debug/images/info.png" alt="Info" />&nbsp;View</td><td>decorate content with "<span class="sfWebDebugLogInfo">sf_app_dir/templates/layout.php</span>"</td></tr>
    <tr class='sfWebDebugLogLine sfWebDebugInfo sfView'><td class="sfWebDebugLogNumber">22</td><td class="sfWebDebugLogType"><img src="/photo/web/sf/sf_web_debug/images/info.png" alt="Info" />&nbsp;View</td><td>render "<span class="sfWebDebugLogInfo">sf_app_dir/templates/layout.php</span>"</td></tr>
    </table></div>
          </div>
          <div id="sfWebDebugConfig" class="top" style="display: none"><h1>Configuration and request variables</h1><ul id="sfWebDebugConfigSummary"><li class="ison">debug</li><li class="isoff">xdebug</li><li class="ison">logging</li><li class="isoff">cache</li><li class="isoff">eaccelerator</li><li class="isoff">apc</li><li class="isoff">xcache</li><li class="isoff">compression</li><li class="isoff last">syck</li></ul>
        <h2>Request <a href="#" onclick="sfWebDebugToggle('sfWebDebugRequest'); return false;"><img src="/photo/web/sf/sf_web_debug/images/toggle.gif" alt="Toggle" /></a></h2>
        <div id="sfWebDebugRequest" style="display: none"><pre>---
    parameterHolder: 
      symfony/default: 
        action: picture
        category_id: 1
        module: category
    attributeHolder: 
      symfony/default: 
    </pre></div>
        
        <h2>Response <a href="#" onclick="sfWebDebugToggle('sfWebDebugResponse'); return false;"><img src="/photo/web/sf/sf_web_debug/images/toggle.gif" alt="Toggle" /></a></h2>
        <div id="sfWebDebugResponse" style="display: none"><pre>---
    cookies: 
    httpHeaders: 
      Content-Type: text/html; charset=utf-8
    parameterHolder: 
      helper/asset/auto/httpmeta: 
        Content-Type: text/html; charset=utf-8
      helper/asset/auto/javascript: 
        /sf/sf_web_debug/js/main: /sf/sf_web_debug/js/main
      helper/asset/auto/meta: 
        description: symfony project
        keywords: symfony, project
        language: en
        robots: index, follow
        title: JHofman Photography Admin
      helper/asset/auto/stylesheet: 
        /sf/sf_web_debug/css/main: 
        adminStyles: 
      symfony/response/http/headers: 
        Content-Type: text/html; charset=utf-8
      symfony/view/asset: 
        javascripts_included: 
        stylesheets_included: 
    </pre></div>
    PHP:
     
    cicciohofman, Aug 3, 2007 IP
  4. exodus

    exodus Well-Known Member

    Messages:
    1,900
    Likes Received:
    35
    Best Answers:
    0
    Trophy Points:
    165
    #4
    Put that in a CODE block, please.

    Are you not finding it odd that the HIEGHT is like the following.

    <img src="/photo/web/images/../uploads/1185833662.jpg" alt="1185833662" height="?" width="300" />
    Code (markup):
    The ? would explain why Firefox is messing up. IE it seems is ignoring the MISTAKE in the code and firefox is not Ignoring it, but rather rendering it as 1 pixel maybe?

    Is there a variable that you forgotten to set?

    <?php echo image_tag('../uploads/' . $picture->getLocation(), 'size=300x?') ?>
    PHP:
    __________________
    Please, don't forget to give Rep [​IMG] is for great answers. :)
     
    exodus, Aug 3, 2007 IP