Multi purpose pages only work with webkit

I am trying to re-use code that worked a couple of years ago, but now is broken in Firefox, Opera, and IE.

I cannot figure out if it is my php or the use of images for the the submit button in the form that sends the info back to the server.

[code]

Ceramic Pieces <?php $dbcnx = @mysql_connect('localhost:/tmp/mysql5.sock', 'artshow', 'art381'); if (!$dbcnx) { exit('

Unable to connect to the database server at this time.

'); } // Select the art database if (!@mysql_select_db('willywor_sas')) { exit('

Unable to locate the student art database at this time.

'); } // if both were up and running, this next bit calls up specific info // from the database and assigns it to a variable. Also checks to see // if a thumbnail has been selected $arts = @mysql_query('SELECT id, arttitle, artmedium, first_name, last_name, filename, award, donors FROM art WHERE categoryid=7'); $curimage = isset($_GET['filename']); if (!$arts) { exit('

Error perfoming query: ' . mysql_error() . '

'); } ?>

Gallery

<?php if (!isset($_GET['id']) OR $_GET['id'] == ''): ?>
<?php

while ($art = mysql_fetch_array($arts)) {
$id = $art[‘id’];
$arttitle = $art[‘arttitle’];
$artmedium = $art[‘artmedium’];
$fname = $art[‘first_name’];
$lname = $art[‘last_name’];
$filename = $art[‘filename’];
$thumbname = $filename . ‘_thm’;
echo “”;
}

?>

<?php echo "Always By Your Side
Acrylic on Canvas
Clinton Bosler" ?>

<?php else: ?> <?php // based on the thumbnail selected, specific information is passed to the reloaded page // the specific info allows us to retrieve the database entries for the given piece of art and assign it variables $curid = $_GET['id']; $curart = @mysql_query("SELECT arttitle, artmedium, filename, first_name, last_name, award, donors FROM art WHERE id='$curid'"); $curart = mysql_fetch_array($curart); $curimage = $curart['filename']; $imagename = $curimage . ".jpg"; $curtitle = $curart['arttitle']; $curmedium = $curart['artmedium']; $curfname = $curart['first_name']; $curlname = $curart['last_name']; $award = $curart['award']; $donors = $curart['donors']; ?>
<?php

while ($art = mysql_fetch_array($arts)) {
$id = $art[‘id’];
$arttitle = $art[‘arttitle’];
$artmedium = $art[‘artmedium’];
$fname = $art[‘first_name’];
$lname = $art[‘last_name’];
$filename = $art[‘filename’];
$thumbname = $filename . ‘_thm’;
echo “”;
}

?>


<?php echo "" . $curtitle . "
" . $curmedium . "
" . $curfname . " " . $curlname . "

";

// This if statement checks to see there is an award entered for this artwork
// It returns different html based on the result
if (!$award) {
echo " ";
} else {

echo "<p><strong>" . $award . 
"</strong><br />Donated by: " . $donors;
}
?></p>
<?php endif; ?> [/code]

Any help would be greatly appreciated

first thing to do is to remove those “@” symbols since those suppress the errors! So remove those and see what errors you get! and never use the @ symbol again. If there is errors that you are suppressing then there is another way to code it that will not create errors!

I’ve removed the “@” symbols and uploaded the revised file. It’s still broken in Firefox. I am looking at Firefox’s Error Console for All Errors, but nothing shows up. No less confused that I was last week…

Is it also “broken” in other browsers?

after a little research I am almost certain it is an issue with firefox and the image button try using css to attach the image to your button this should resolve the issue

I’ve tested it on Firefox, Opera, and IE, and it’s broken in all

Can you be more specific, what exactly is broken?

This is a gallery page from our student art show. There are thumbnail images and one large shot of a selected work along with title, artist, etc… The image file name and information come from a mySQL database and are supposed to update on screen as the page reloads after a thumbnail is selected.

When clicking a thumbnail, I can see the x & y data appended to the end of the file in the browser, so I’m fairly certain that the page is indeed refreshing, but the image and information are not updated. This all worked fine 3 years ago, and it still works as expected in webkit browsers.

I agree with plintu. The type=“image” is not being used correctly. You could possibly try one of these methods instead:

<input type="submit" name="id" value="$id" style="background:url('http://..../');" />
<button name="id" value="$id"><img src="http://..../" /></button>
Sponsor our Newsletter | Privacy Policy | Terms of Service