SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    Non-Member
    Join Date
    Jan 2004
    Location
    Seattle
    Posts
    4,328
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Page Won't Load in Internet Explorer

    I'm not sure where to post this, so I thought I'd start here, since I'm working with PHP/MySQL. My page at www.geosymbols.org/world/na/usa/wy/flower/ loads fine in Firefox, but it either doesn't load in Internet Explorer or it does so extremely slowly. I certainly haven't been able to open it yet.

    The same thing is true on my local site; when I try to access tha page, it freezes. There are probably similar pages - this is just the first one I've discovered.

    It may be kind of pointless posting in a PHP forum without posting any PHP script, but I simply have too much to paste here. I thought maybe someone might find a clue in my source code. Maybe it's a JavaScript problem, but I thought I should post here first.

    Thanks!

  2. #2
    Non-Member
    Join Date
    Jan 2004
    Location
    Seattle
    Posts
    4,328
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Aha! I just discovered that the problem is with my new script. It's designed to display images regardless of size and file extension. I recently added a script that makes it ignore folders with the same names as images.

    Anyway, I just tested it and discovered that it won't work with IE. Can anyone tell me why and how to fix it?

    Thanks.

    PHP Code:
    $imgDir '/images/plants/flowers/world/'.$PicLink.''.$Parent.'/';
    $imgPath $_SERVER['DOCUMENT_ROOT'] . $imgDir;
    $img glob($imgPath $mycode2.'*');

    // NEW SCRIPT
    if (empty($img))
    {
    echo (
    '<div style="padding: 10px; background: #000; color: #fff; float: right; margin-left: 15px;">Sorry, no pictures yet.</div>');
    }
    else
    {
    // (continued)

    foreach($img as $path){
        if(
    preg_match("[\.gif$|\.jpg$|\.png$]",$path)){
            
    $image=$path;
            break;
        }
    }
     if (
    file_exists($image)) {
        list(
    $width$height$type$attr) = getimagesize($image);
        
    $image=str_replace($_SERVER['DOCUMENT_ROOT'],"",$image);
        echo 
    "<div style=\"width:$width$BorderDiv\"".     
            
    " class=\"$ImgClass\">";
        echo 
    "<img src=\"$image\" $attr alt=\"$myname\" style=\"".
            
    "$StyleImg\" />$CreditFlower $BigFlower</div>";
    }
    // End NEW SCRIPT...


  3. #3
    SitePoint Wizard Dylan B's Avatar
    Join Date
    Jul 2004
    Location
    NYC
    Posts
    1,150
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It's a display issue, I'm pretty sure; PHP/MySQL have nothing to do with the browser.

    Post the HTML produced when the script is ran.

  4. #4
    Non-Member
    Join Date
    Jan 2004
    Location
    Seattle
    Posts
    4,328
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks. I just discovered that the page displays in Internet Explorer if I remove this portion of the script:

    PHP Code:
    foreach($img as $path){
        if(
    preg_match("[\.gif$|\.jpg$|\.png$]",$path)){
            
    $image=$path;
            break;
        }

    Unfortunately, that kills the entire script; no image displays at all.

    If I stick the above back in the main script and preview the entire script in Firefox, I get the following html for the image that displays:

    PHP Code:
    <div style="width:250 pixels; margin-right: -40px; border-bottom: 1px solid #000;" class="fright"><img src="/images/plants/flowers/world/na/usa/wy.jpg" width="250" height="150" alt="Wyoming’s State Flower" style="" /> </div
    Incidentally, the div width - 250 pixels - doesn't validate, and I haven't figure out how to fix it yet, but I doubt that that has anything to do with this problem.

    I wonder if this has something to do with Windows weird folder conventions. For example, I can't create a folder named con on my computer because Windows has reserved "con." And if I try to save an image to usa.jpg and there just happens to be a folder named "usa" in the same directory, Windows saves usa.jpg inside folder usa, rather than OUTSIDE folder usa, where I want it.

    So I suspect maybe Internet Explorer is similarly wired for the Twilight Zone, and there may be no way around it.

    Thanks.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •