www.webdeveloper.com
Results 1 to 9 of 9

Thread: [RESOLVED] Problem with OPERA AND IE 7 8

  1. #1
    Join Date
    Jan 2009
    Posts
    31

    resolved [RESOLVED] Problem with OPERA AND IE 7 8

    i have a site thats look fine with ie 6 and firefox
    but not with ie7 and opera

    this is the code of the php file

    site link http://fgs.co.il

    Code:
    $sql = mysql_query("SELECT * FROM ava_games WHERE published=1 ORDER BY id desc LIMIT 6");
    	while($row = mysql_fetch_array($sql))
    	{
    		$abcd= $row['name'];
    		$abcd = str_replace (" ", "-", $abcd);
    			
    			if ($seo_on == 0) 
    			{
    				$url = games.php?task=view&id='.$row['id'].'';
    			}
    			else 
    			{
    				$url = 'view/'.$row['id'].'/'.$abcd.'.htm';
    			}
    
    		echo '&nbsp;<a href="'.$site_url.'/'.$url.'"><img src="'.$row['image'].'" width="100" height="75" alt="'.$row['name'].'"></a>';
    	}
    ?>

    this code show the new games in the side bar ..

    i want to add table code to this file ..
    somethig like that:

    <table width ....... >

    echo '&nbsp;<a href="'.$site_url.'/'.$url.'"><img src="'.$row['image'].'" width="100" height="75" alt="'.$row['name'].'"></a>';

    </table>



    firefox
    http://img136.imageshack.us/my.php?image=26414917.jpg


    opera
    http://img136.imageshack.us/my.php?image=91489445.jpg



    tnx

  2. #2
    Jgy3183 is offline Web Applications Develope
    Join Date
    Mar 2009
    Posts
    29
    maybe its because you aren't encapsulating the <a>'s in cells in rows...
    try:

    Code:
    <table width ......>
    <tr>
    <td>
         <a href........></a>
    </td>
    </tr>
    </table>

  3. #3
    Join Date
    Jan 2009
    Posts
    31
    allready tried ... doenst help
    i need to echo <table> </table> only 1 time ...

    sorty gor my bad english

  4. #4
    Jgy3183 is offline Web Applications Develope
    Join Date
    Mar 2009
    Posts
    29
    try this:

    Code:
    echo '&nbsp;<tr><td><a href="'.$site_url.'/'.$url.'"><img src="'.$row['image'].'" width="100" height="75" alt="'.$row['name'].'"></a></td></tr>';

  5. #5
    Join Date
    Jan 2009
    Posts
    31
    no didnt help

    how can i echo something only 1 time

    this is doing the same code 6 times

    echo '&nbsp;<a href="'.$site_url.'/'.$url.'"><img src="'.$row['image'].'" width="100" height="75" alt="'.$row['name'].'"></a>';

    i nned to echo befor it 1 time
    and after 1 time
    Last edited by xxhunterxx; 03-26-2009 at 07:02 PM.

  6. #6
    Jgy3183 is offline Web Applications Develope
    Join Date
    Mar 2009
    Posts
    29
    well that echo statement has to repeat to get all the proper links in the database. but if you put the echo "<table>" and echo "</table>" outside the link, it should properly generate an HTML table with the links in their own rows. i'm going to copy your code, and put echo statements for the open and close table tags:

    $sql = mysql_query("SELECT * FROM ava_games WHERE published=1 ORDER BY id desc LIMIT 6");
    echo '<table>';
    while($row = mysql_fetch_array($sql))
    {
    $abcd= $row['name'];
    $abcd = str_replace (" ", "-", $abcd);

    if ($seo_on == 0)
    {
    $url = games.php?task=view&id='.$row['id'].'';
    }
    else
    {
    $url = 'view/'.$row['id'].'/'.$abcd.'.htm';
    }
    echo '<tr><td>'; //need to have data in table cells if you want a table
    echo '&nbsp;<a href="'.$site_url.'/'.$url.'"><img src="'.$row['image'].'" width="100" height="75" alt="'.$row['name'].'"></a>';
    echo '</td></tr>'; //now each link will be in its own row and cell in one big table
    }
    echo '</table>';
    ?>

  7. #7
    Join Date
    Jan 2009
    Posts
    31
    tnx
    now the game images are 1 under the other
    i want to put 2 images in the same line

  8. #8
    Jgy3183 is offline Web Applications Develope
    Join Date
    Mar 2009
    Posts
    29
    okie dokie..try using a counter like in the following code: (I apologize for any php syntax errors that might happen..dont have php parser at my disposal right now, so no real way to test:

    Code:
    $sql = mysql_query("SELECT * FROM ava_games WHERE published=1 ORDER BY id desc LIMIT 6");
    echo '<table>'; 
    	
    	$cellCounter=0; //Initialize cell counter variable
    
    
    	while($row = mysql_fetch_array($sql))
    	{
    		$abcd= $row['name'];
    		$abcd = str_replace (" ", "-", $abcd);
    	
    		if ($seo_on == 0) 
    		{
    			$url = games.php?task=view&id='.$row['id'].'';
    		}
    		else 
    		{
    			$url = 'view/'.$row['id'].'/'.$abcd.'.htm';
    		}
    			
    		if($cellCounter==2)
    		{
    			echo '</tr>'; //Close the row
    			echo '<tr>'; //Open new row for next group of two cells
    			
    			$cellCounter=0; //Re-set counter variable
    		}
    		
    		if($cellCounter==0)
    		{
    			echo '<tr>'; //First row for data
    		}
    
    		echo '<td>'; //need to have data in table cells if you want a table
    
    		echo '&nbsp;<a href="'.$site_url.'/'.$url.'"><img src="'.$row['image'].'" width="100" height="75" alt="'.$row['name'].'"></a>';
    
    		echo '</td>';
    		$cellCounter=$cellCounter+1;
    		
    	}
    echo '</table>';

  9. #9
    Join Date
    Jan 2009
    Posts
    31
    tnx tnx a lot work great

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles