Click to See Complete Forum and Search --> : [RESOLVED] Problem with OPERA AND IE 7 8
xxhunterxx
03-26-2009, 11:12 AM
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
$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 ' <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 ' <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
Jgy3183
03-26-2009, 03:27 PM
maybe its because you aren't encapsulating the <a>'s in cells in rows...
try:
<table width ......>
<tr>
<td>
<a href........></a>
</td>
</tr>
</table>
xxhunterxx
03-26-2009, 04:12 PM
allready tried ... doenst help
i need to echo <table> </table> only 1 time ...
sorty gor my bad english
Jgy3183
03-26-2009, 04:16 PM
try this:
echo ' <tr><td><a href="'.$site_url.'/'.$url.'"><img src="'.$row['image'].'" width="100" height="75" alt="'.$row['name'].'"></a></td></tr>';
xxhunterxx
03-26-2009, 05:21 PM
no didnt help
how can i echo something only 1 time
this is doing the same code 6 times
echo ' <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
Jgy3183
03-27-2009, 07:50 AM
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 ' <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>';
?>
xxhunterxx
03-27-2009, 11:19 AM
tnx
now the game images are 1 under the other
i want to put 2 images in the same line
Jgy3183
03-27-2009, 01:36 PM
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:
$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 ' <a href="'.$site_url.'/'.$url.'"><img src="'.$row['image'].'" width="100" height="75" alt="'.$row['name'].'"></a>';
echo '</td>';
$cellCounter=$cellCounter+1;
}
echo '</table>';
xxhunterxx
03-27-2009, 03:23 PM
tnx tnx a lot work great