images not displayed in firefox 3.0.1
Stefan
- php
3 Rouven0 Der Martin
Hi!
I am using the following code to dynamically create a table displaying users stored in a database.
I am creating hyperlinks with small icons for actions you can perform on users.
This works fine in IE, but in Firefox (3.0.1) only the 'alt' text gets showed.
If I directly enter the url of an icon, firefox shows it.
Can someone figure out what might be the problem ?
function list_operators()
{
$query = mssql_init("OP_GetAllOperators");
$result = mssql_execute($query);
draw_operator_menu_caption();
create_menu_entry("?page=show_operators&add_user=1","add operator","447780","ffffff");
echo("<h4>");
echo("<br><br>");
echo("<table border='0' cellspacing='0'>");
echo("<tr bgcolor='#99CCFF'><td width=414 colspan=6> Operators in System </td></tr>");
echo("<tr bgcolor='#99CCFF'>");
echo("<td width=70> Name </td>");
echo("<td width=50> Pwd </td>");
echo("<td width=100> Roles </td>");
echo("<td width=140> Description </td>");
echo("<td width=60> Status </td>");
echo("<td> Option </td></tr>");
echo("<tr><td> </td></tr>");
for ($i=0; $i < mssql_num_rows($result); $i++)
{
$bgcol = ($i%2 == 0 ? '#f0f0f0' : '#b0b0b0' );
$name = mssql_result($result,$i,"OPName");
$pwd = mssql_result($result,$i,"OPPassword");
$desc = mssql_result($result,$i,"Description");
$status = mssql_result($result,$i,"Status");
$guid = mssql_guid_string(mssql_result($result,$i,"PKOperator"));
$roles ="";
$q2 = mssql_init("ROLES_GetRolesForOperatorID");
mssql_bind($q2, "@opguid", &$guid, SQLVARCHAR,false,false,38);
$r2 = mssql_execute($q2);
for ($j=0; $j < mssql_num_rows($r2); $j++)
{
$roles .= mssql_result($r2,$j,"RoleName");
$roles .= "<br>";
}
echo("<tr bgcolor=$bgcol>");
//echo("<td > $name </td>");
echo("<td ><a href='?page=show_operators&show_details=1&username=$name&userid=$guid'> $name </a></td>");
if ( GetUserPermissionLevel() > 0)
{
echo("<td > $pwd </td>");
}
else
{
echo("<td> ** </td>");
}
echo("<td > $roles </td>");
echo("<td > $desc </td>");
echo("<td > $status </td>");
echo("<td>");
if ( GetUserPermissionLevel() > 0)
{
echo("<a href='?page=show_operators&delete_user=1&username=$name&userid=$guid'><img src='.\icons\action_delete.png' width='16' height='16' alt='delete' border='0' ></a> ");
echo("<a href='?page=show_operators&change_pwd=1&username=$name&userid=$guid'><img src='.\icons\login.png' width='16' height='16' alt='change password' border='0'></a> ");
echo("<a href='?page=show_operators&add_role=1&username=$name&userid=$guid'><img src='.\icons\maximize.png' width='16' height='16' alt='add role' border='0'></a> ");
echo("<a href='?page=show_operators&rem_role=1&username=$name&userid=$guid'><img src='.\icons\minimize.png' width='16' height='16' alt='remove role' border='0'></a> ");
}
echo("</td>");
echo("</tr>");
}
echo("</table>");
echo("<br>");
echo("</h4>");
}
Hello,
I am using the following code to dynamically create a table displaying users stored in a database.
please make sure you understand the difference between server-side and client-side code. The PHP-code is executed directly on the server and in almost all cases complete independent from the browser which has launched the request. It is therefor not possible to determine your actual problem by looking at the PHP-code, only the HTML-output is relevant.
echo("<a href='?page=show_operators&rem_role=1&username=$name&userid=$guid'><img src='.\icons\minimize.png' width='16' height='16' alt='remove role' border='0'></a> ");
This looks like a candidate that could kill non-IEs: you are using backslashes in the image-url. Please use forward slashes as required in URLs.
MfG
Rouven
Hi Stefan,
your name doesn't sound as if you were English or American, but maybe you aren't German either. ;-)
I am using the following code to dynamically create a table displaying users stored in a database.
Christoph Schnauß, a regular in this forum, once wrote (translated):
Databases do not store users.
That's because right now databases still have problems with the supply
of nutrition for stored biological lifeforms.
Okay, back to topic:
I am creating hyperlinks with small icons for actions you can perform on users.
This works fine in IE, but in Firefox (3.0.1) only the 'alt' text gets showed.
Yes, this problem of IE is well-known.
echo("<a href='?page=show_operators&delete_user=1&username=$name&userid=$guid'><img src='.\icons\action_delete.png' width='16' height='16' alt='delete' border='0' ></a> ");
What the heck is a backslah good for in a URL path?
IE has a built-in pseudo intelligence that transforms backslashes to regular forward slashes before the URL is submitted to the server. Firefox, however, does not do such a translation, an so the server tries to locate files with backslashes in their names.
I'm surprised, though, that you say Firefox does show the images when you directly enter the URL in the address bar. Did you fix the backslashes manually when you tried that?
Hope that helps,
Martin
Hi Stefan,
your name doesn't sound as if you were English or American, but maybe you aren't German either. ;-)
I am Austrian actually. You came very close ;-)
What the heck is a backslah good for in a URL path?
IE has a built-in pseudo intelligence that transforms backslashes to regular forward slashes before the URL is submitted to the server. Firefox, however, does not do such a translation, an so the server tries to locate files with backslashes in their names.
The backslashes caused the problem. I Changed them to forward slashes and now it's working fine now. Thank you very much!
Best regards,
Stefan
Mahlzeit Stefan,
your name doesn't sound as if you were English or American, but maybe you aren't German either. ;-)
I am Austrian actually. You came very close ;-)
Hm. Und warum schreibst Du dann in einem deutschsprachigen Forum nicht deutsch? Als Österreicher müsste man das doch - einigermaßen - beherrschen, oder?
The backslashes caused the problem. I Changed them to forward slashes and now it's working fine now. Thank you very much!
Kaum macht man's richtig ... ;-)
MfG,
EKKi