Current location: Hot Scripts Forums » Programming Languages » PHP » I'm having a problem in firefox but not IE


I'm having a problem in firefox but not IE

Reply
  #1 (permalink)  
Old 11-30-05, 02:48 PM
xxvatarxx xxvatarxx is offline
Wannabe Coder
 
Join Date: May 2005
Posts: 212
Thanks: 0
Thanked 0 Times in 0 Posts
I'm having a problem in firefox but not IE

Ok, this is really bugging me.... i'm having a problem with one page.... it has a php include which includes a script for generating thumbnails "on the fly". It is embedded in a page which uses alot of css.... the css is sound (as all the other pages work fine.
In IE it is perfect, but in firefox the background is somewhat black/invisible ?
The page is located here http://www.crossgeneration.co.uk/school%20pictures
Please any feedback is much appreciated
Reply With Quote
  #2 (permalink)  
Old 11-30-05, 02:57 PM
UnrealEd's Avatar
UnrealEd UnrealEd is offline
Community Liaison
 
Join Date: May 2005
Location: Antwerp, Belgium
Posts: 3,165
Thanks: 4
Thanked 25 Times in 25 Posts
this has nothing to do with php or mysql, this has something to do, with the browser your using.

Every browser interprets html differently. I had the same problem myself.
My sollution: i switched to flash

Greetz,
UnrealEd
Reply With Quote
  #3 (permalink)  
Old 11-30-05, 03:12 PM
xxvatarxx xxvatarxx is offline
Wannabe Coder
 
Join Date: May 2005
Posts: 212
Thanks: 0
Thanked 0 Times in 0 Posts
surely there must be somesort of fix or work around for it?

I can't just leave it as it is and flash is a pain in the ***.
Reply With Quote
  #4 (permalink)  
Old 12-01-05, 07:39 AM
koncept
Guest
 
Posts: n/a
i think there is. firefox is interpreting the page differently than ie but i have never had them be that different. are there any style sheets used besides the one in the page when you view source? i will try to look at the code and see if i see it.
Reply With Quote
  #5 (permalink)  
Old 12-01-05, 07:45 AM
koncept
Guest
 
Posts: n/a
Post

you have some very poor coding techniques

you cannot have 3 head sections, 2 doc types and 4 body sections. edit the out put so that it looks like this... it should solve some problems
Code:
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
 <head>
 <title>Crossgeneration, A local site for local people!</title>
 <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
 <meta name="keywords" content="Site keywords here" />
 <meta name="description" content="Site description here" />
 <meta name="author" content="Your name here" />
 <script src="menu.js" language="javascript"  type="text/javascript"></script>
 <link rel="stylesheet" type="text/css" href="css/style.css" />
 <style type="text/css">
 
 body {background-color: #ffffff; text-align: center; font-family: verdana; font-size: 12px; color: #fff;}
 h1 {font-size: 16px; margin: 1em; }
 
 #dirnav {height: 16px; position: relative; margin: auto auto 5px auto; clear: both;  border-bottom: 1px solid #aaa; text-align: center; padding: 3px; }
 #dirnav ul, #dirnav li {margin: auto; padding: 0; list-style-type: none; }
 #dirnav li {float: left; text-align: center;  }
 #dirnav a {display: block; padding: 2px 5px 2px 5px; }
 
 #thumbs {width: 100%; margin: 10px; border: 1px solid black; clear: both; text-align: center; }
 p.thumb {width: 168px; height: 182px; margin: 1em; padding: 3px; float: left; border: 1px solid #000; font-size: 12px; text-align: center; }
 
 #nav {position: relative; margin: auto; clear: both;  border-top: 1px solid #aaa; text-align: center; }
 #nav ul, #nav li {margin: auto; padding: 0; list-style-type: none; }
 #nav li {float: left; text-align: center;  }
 #nav li.current a.page {font-weight: bold; color: #ddd; }
 #nav a {}
 #nav a.page {display: block; padding: 2px 5px 2px 5px; }
 #nav a.prev, #nav a.next , #nav .prev, #nav .next {display: block; width: 65px; padding: 2px 5px 2px 5px; }
 #nav a:hover { }
 
 a {color: #999; text-decoration: none; }
 a:hover, a:active {color: #d0d0d0; }
 a img {border: 1px solid #777; }
 a:hover img {border: 1px solid #d0d0d0; }
 a.page {color: #999; }
 
 </style>
 </head>
 <body>
 <div id="head"> 
   <h1>Crossgeneration</h1>
 </div>
 <div id="navigation"> 
   <ul>
 	<li><a href="http://www.crossgeneration.co.uk" title=""><span>Home</span></a></li>
 	<li><a href="http://www.crossgeneration.co.uk/Games.html" title=""><span>Games</span></a></li>
 	<li><a href="#" title=""><span>Videos</span></a></li>
 	<li><a href="#" title=""><span>Tools</span></a></li>
 	<li><a href="#" title=""><span>Get Involved</span></a></li>
 	<li><a href="http://www.crossgeneration.co.uk/about.php" title=""><span>About 
 	  Us</span></a></li>
   </ul>
 </div></div>
 <div id="sidebar"> 
   <h3>Navigation</h3>
   <ul>
 	<li><a href="#" title="">Gonna add more links soon ;-)</a></li>
   </ul>
   <h3>Expandable</h3>
   <p></p>
 </div><div id="main">
 <h1>Photo Gallery: school pictures</h1>
 <p class='thumb'> <tt> <a href='Aimee tongue.JPG'><img src='image_resize.php?i=Aimee tongue.JPG&w=150&h=150' alt='Aimee tongue.JPG' /><br />
   Aimee tongue.JPG<br />
   </a> [2048 x 1536] - [846.96 KB] <br />
   </tt> </p>
 <p class='thumb'> <tt> <a href='Aimee.JPG'><img src='image_resize.php?i=Aimee.JPG&w=150&h=150' alt='Aimee.JPG' /><br />
   Aimee.JPG<br />
   </a> [1536 x 2048] - [881.56 KB] <br />
   </tt> </p>
 <p class='thumb'> <tt> <a href='IMG_0007.JPG'><img src='image_resize.php?i=IMG_0007.JPG&w=150&h=150' alt='IMG_0007.JPG' /><br />
   IMG_0007.JPG<br />
   </a> [1536 x 2048] - [906.47 KB] <br />
   </tt> </p>
 <p class='thumb'> <tt> <a href='Lexy pexy.JPG'><img src='image_resize.php?i=Lexy pexy.JPG&w=150&h=150' alt='Lexy pexy.JPG' /><br />
   Lexy pexy.JPG<br />
   </a> [2048 x 1536] - [1.21 MB] <br />
   </tt> </p>
 <p class='thumb'> <tt> <a href='Liv and la (again).JPG'><img src='image_resize.php?i=Liv and la (again).JPG&w=150&h=150' alt='Liv and la (again).JPG' /><br />
   Liv and la (again).JPG<br />
   </a> [2048 x 1536] - [1.08 MB] <br />
   </tt> </p>
 <p class='thumb'> <tt> <a href='Livvi And la.JPG'><img src='image_resize.php?i=Livvi And la.JPG&w=150&h=150' alt='Livvi And la.JPG' /><br />
   Livvi And la.JPG<br />
   </a> [2048 x 1536] - [979.88 KB] <br />
   </tt> </p>
 <p class='thumb'> <tt> <a href='Matthew Mathers.JPG'><img src='image_resize.php?i=Matthew Mathers.JPG&w=150&h=150' alt='Matthew Mathers.JPG' /><br />
   Matthew Mathers.JPG<br />
   </a> [2048 x 1536] - [1.21 MB] <br />
   </tt> </p>
 <p class='thumb'> <tt> <a href='Mr Kane.JPG'><img src='image_resize.php?i=Mr Kane.JPG&w=150&h=150' alt='Mr Kane.JPG' /><br />
   Mr Kane.JPG<br />
   </a> [2048 x 1536] - [751.41 KB] <br />
   </tt> </p>
 <p class='thumb'> <tt> <a href='Shorrock looking oldish.JPG'><img src='image_resize.php?i=Shorrock looking oldish.JPG&w=150&h=150' alt='Shorrock looking oldish.JPG' /><br />
   Shorrock looking oldish.JPG<br />
   </a> [2048 x 1536] - [996.27 KB] <br />
   </tt> </p>
 <p class='thumb'> <tt> <a href='Shorrock.jpg'><img src='image_resize.php?i=Shorrock.jpg&w=150&h=150' alt='Shorrock.jpg' /><br />
   Shorrock<br />
   </a> [2048 x 1536] - [951.65 KB] <br />
   </tt> </p></div><div id='nav'>
 <li>
   <div class='prev'>&laquo; Previous Page</div>
 </li>
 <li class="current"><a class='page' href='?pg=1'>[1]</a></li>
 <li><a class='page' href='?pg=2'>[2]</a></li>
 <li><a class='next' href='?pg=2'>Next Page &raquo;</a></li>
 
 </div>
 <div id="foot"> <font face="arial" size="1"> 
   <center>
 	&copy 1999 - 2005 Crossgeneration, all rights reserved.<br>
 	Reproducing or copying any material found on this page is <b>not</b> allowed.<br>
 	Crossgeneration is best viewed in 1024x768 resolution or higher.<br>
 	Designed for Firefox and Netscape<br>
   </center>
   </font> </div></body>
 </body>
 </html>
i have not tried it since i dont feel like changing links. but just save it as a html file and try it
Reply With Quote
  #6 (permalink)  
Old 12-01-05, 04:08 PM
xxvatarxx xxvatarxx is offline
Wannabe Coder
 
Join Date: May 2005
Posts: 212
Thanks: 0
Thanked 0 Times in 0 Posts
That page wasn't coded by me, im just including a premade script (i'm not all that good with php... i can edit but thats about it)

The css can be viewed (probably not all that well coded)here

The code of the page is here

Code:
<?php include("header.php"); ?>

<body>

<div id="head">
<h1>Crossgeneration</h1>
</div>

<div id="navigation">
<ul>
<?php include("menu.php"); ?>
</ul>
</div>

</div>

<div id="sidebar">

<h3>Navigation</h3>
<ul>
	<li><a href="#" title="">Gonna add more links soon ;-)</a></li>

</ul>

<h3>Expandable</h3>
<p></p>

</div>


<div id="main">


<?php
include("gallery.php"); 
?>



</div>



<div id="foot">
<?php include("footer.php"); ?>

</div>

</body>
and the code for "gallery.php" is below

Code:
 <?php

$limit = 10;           // number of thumbs to show per page.
$w = 150;              // max width of thumbnails.
$h = 150;              // max height of thumbnails.
$show_folders = 0;     // Set to 1 to show folder list, 0 to turn off
$isize = 1;            // Set to 1 to display image filesize
$idim = 1;             // Set to 1 to display image dimensions

//============================================
// No further options below here.

if($pg = $_GET['pg'])
{
  $thumb = (($pg-1)*$limit);
  $i = $thumb;
}
//if($thumb = $_GET['thumb'])
//  $i = $thumb;
else
  $i = 0;

// get the directory name
$dirlist = dirname($_SERVER['SCRIPT_NAME']);

// split it up
$subdir = explode("/", $dirlist);

// reverse it so directory above images is listed
$subdir = array_reverse($subdir);

// page title name is root dir.
$title = str_replace("_", " ", $subdir['0']);

//$my_uri = "http://" . $_SERVER['HTTP_HOST'] . $HTTP_SERVER_VARS["SCRIPT_NAME"];

if(ereg("\.\.", $_GET['d']))
  header ("Location: ?");


?>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
	"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Photo Gallery - <? echo $title; ?></title>
<style type="text/css">

body {background-color: #ffffff; text-align: center; font-family: verdana; font-size: 12px; color: #fff;}
h1 {font-size: 16px; margin: 1em; }

#dirnav {height: 16px; position: relative; margin: auto auto 5px auto; clear: both;  border-bottom: 1px solid #aaa; text-align: center; padding: 3px; }
#dirnav ul, #dirnav li {margin: auto; padding: 0; list-style-type: none; }
#dirnav li {float: left; text-align: center;  }
#dirnav a {display: block; padding: 2px 5px 2px 5px; }

#thumbs {width: 100%; margin: 10px; border: 1px solid black; clear: both; text-align: center; }
p.thumb {width: <? echo $w+18; ?>px; height: <? echo $h+32; ?>px; margin: 1em; padding: 3px; float: left; border: 1px solid #000; font-size: 12px; text-align: center; }

#nav {position: relative; margin: auto; clear: both;  border-top: 1px solid #aaa; text-align: center; }
#nav ul, #nav li {margin: auto; padding: 0; list-style-type: none; }
#nav li {float: left; text-align: center;  }
#nav li.current a.page {font-weight: bold; color: #ddd; }
#nav a {}
#nav a.page {display: block; padding: 2px 5px 2px 5px; }
#nav a.prev, #nav a.next , #nav .prev, #nav .next {display: block; width: 65px; padding: 2px 5px 2px 5px; }
#nav a:hover { }

a {color: #999; text-decoration: none; }
a:hover, a:active {color: #d0d0d0; }
a img {border: 1px solid #777; }
a:hover img {border: 1px solid #d0d0d0; }
a.page {color: #999; }

</style>
</head>


<?

echo '<h1>Photo Gallery: '.$title.'</h1>';



//-------------------------------- Directory Navigation -----------------------------
function dir_list($dir)
{
  global $title;
  $dlist = array();

  if ($hdir = opendir('./'.$dir))
  {
    while ($obj = readdir($hdir))
      {
        if (((preg_match("/^\./",$obj)==0) && (!eregi('^(.*).[php]$', $obj))) && is_dir($dir.$obj))
        //if(is_dir($dir.$obj))
          $dlist[] = $obj;
      }
    closedir($hdir);
  }
  else 
    die('Cannot list files for ' . $dir);

  asort($dlist);
  echo "<div id='dirnav'><ul>\n<li>Folders:</li>\n";

  echo "<li> <a href='?'>$title &raquo; </a></li>\n";
    $dirtree = explode("/", $_GET['d']); // parse directory tree from passed "d"
  if(!$_GET['d'])
    array_shift($dirtree); // remove redundant "." directory from tree 
    foreach ($dirtree as $dirsub)
    {
	    echo "<li> <a href='?d=$dirparent$dirsub'>$dirsub &raquo; </a></li>\n";
	    $dirparent .= $dirsub.'/';
    }

  foreach ($dlist as $link)
  {
    echo "<li><a href='?d=$dir$link'>[$link]</a></li>\n";
  }
  echo "</ul>\n</div>\n";
}



//-------------------------------------Get image file size ----------------------------------
function getfilesize($size)
{
  $units = array(' B', ' KB', ' MB', ' GB', ' TB');
  for ($i = 0; $size > 1024; $i++) { $size /= 1024; }
  return round($size, 2).$units[$i];
}



//-------------------------------------Set which folder we are viewing----------------



if($_GET['d'])
{
  $d = $_GET['d'].'/';
  $dd = 'd='.$_GET['d'].'&'; // for use in passing to URL strings
  $current_dir .= $d;
}

 opendir($current_dir);

if ($show_folders)
  dir_list($current_dir);



//--------------------------------------- Create list of Images ------------------------
$list = array();

if ($dir = opendir('./'.$current_dir))
{
  while ($file = readdir($dir))
  {
      //if((is_file($file)) && ((!eregi('^(.*).[php]$', $file)) && (!eregi('^(\.htaccess)$', $file))))
      //if((eregi('^(.*).[jpg]$', $file)) && (!eregi('^(.*).[php]$', $file)))
      //if (eregi('^(([:alnum:])*)\.((j|J)(p|P)(g|G)))$', $file))

    if (eregi('.jpg', $file)) //If file is a JPG
      $list[] = $file;
  }
    closedir($dir);
}

asort($list); // sort alpha
$numtotal = count($list); //total number of thumbs

if ($thumb)
{
  $s = 0;
  while($s < $thumb)
  {
    array_shift($list);
    $s++;
  }
}

$numremain = count($list); // total remaining thumbs



//-------------------------------------- Create Thumbnails and Gallery ------------------
foreach ($list as $pic)
{
   	$fp = $current_dir.$pic;
   	if($i < $thumb+$limit)
   	{
	  //echo "<p class='thumb'><tt><a href='$current_dir$pic'><img src='tn/$pic' alt='$pic' /><br />$pic</a> - [".getfilesize(filesize($fp))."]</tt></p>\n";
	  $image = $currentdir.$pic;
	  $i_size = getfilesize(filesize($fp));
	  $i_area = getimagesize($fp);
	  $i_width = $i_area[0];
	  $i_height = $i_area[1];
	  //$i_mtime = date("d F Y ", filemtime($fp));
	  $name = str_replace('.jpg', '', $pic);
	  echo "<p class='thumb'>
	  			<tt>
	  				<a href='$current_dir$pic'><img src='image_resize.php?i=$d$pic&w=$w&h=$h' alt='$pic' /><br />
	  				$name<br /></a>\n";
	    if($idim)
	  	echo "			[$i_width x $i_height]";
	    if($idim && $isize)
	        echo " - ";
	    if ($isize)
	    	echo "			[$i_size]";
	  echo "		<br />
	  			</tt>
	  		</p>\n";
	  $i++;
	}
}




//---------------------------------------Page Navigation -----------------------------
$page = 0;
if(!$pg)
  $pg = 1;
echo "<div id='nav'>\n<ul>\n";

if($thumb > 0)
  echo "<li><a class='prev' href='?".$dd."pg=".($pg-1)."'>&laquo; Previous Page</a></li>\n";
else
  echo "<li><div class='prev'>&laquo; Previous Page</div></li>";

while($page*$limit < $numtotal)
{
  $page ++;
  unset($cur);
  if($page == $pg)
  {
    $cur = ' class="current"';
  }
  echo "<li$cur><a class='page' href='?".$dd."pg=$page'>[".($page)."]</a></li>\n";
}

if($numremain > $limit)
  echo "<li><a class='next' href='?".$dd."pg=".($pg+1)."'>Next Page &raquo;</a></li>\n";
else
  echo "<li><div class='next'>Next Page &raquo;</div></li>\n";


?>
Reply With Quote
  #7 (permalink)  
Old 12-01-05, 05:30 PM
xxvatarxx xxvatarxx is offline
Wannabe Coder
 
Join Date: May 2005
Posts: 212
Thanks: 0
Thanked 0 Times in 0 Posts
The css can be viewed (probably not all that well coded)here

Soz thats the correct link.... and dnt say double posts are bad.... cus this invision pewerboard doesn't let me edit posts.
Reply With Quote
  #8 (permalink)  
Old 12-02-05, 10:28 AM
koncept
Guest
 
Posts: n/a
can you post the code for menu and header too??

did the straight html page i posted show correctly in both browsers??
Reply With Quote
  #9 (permalink)  
Old 12-02-05, 02:37 PM
xxvatarxx xxvatarxx is offline
Wannabe Coder
 
Join Date: May 2005
Posts: 212
Thanks: 0
Thanked 0 Times in 0 Posts
the straight html page worked fine...... so i know the problem can be fixed..... but still need help on how
Reply With Quote
  #10 (permalink)  
Old 12-02-05, 02:49 PM
koncept
Guest
 
Posts: n/a
if you post the code for the menu and header files (or just put the 4 files in a zip) and post them I will be glad to go through and tweak the code so it works.
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
CSS Border problem in FireFox mani786 CSS 1 10-01-05 07:33 AM
Caching Problem w/ Dynamic Pages Monarch JavaScript 0 08-09-05 08:32 AM
how can i fix window.resizeto problem in firefox rdnpa JavaScript 1 01-20-05 09:35 AM
Count problem kasic ASP.NET 1 10-20-04 12:23 AM
Asp and Microsoft Access 2002 problem gop373 ASP 2 10-06-04 09:13 AM


All times are GMT -5. The time now is 06:21 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.