Not sure if this post belongs in PHP or Javascript forum. But it seems a javascrips problem I think.
Using mysql and PHP I am selecting data from a database to display but first I want to invoke a javascript alert box to tell the user that he has been successful. All worked perfectly in all browsers until the recent update to Firefox 3.0.6 – still works perfectly IE, Safari and Opera.
Firefox now gets stuck on a blank page instead of displaying the javascript alert – when I click refresh on the blank page all then work OK. My code looks like this:
[code=php]
// select records from the database table:
mysql_select_db($db) or die (“Unable to get into the database!”);
$query = “SELECT field1, field2, field3 FROM tablename
WHERE field1=’$field1′”;
$result = mysql_query($query) or die
(“MySQL error: $query. ” . mysql_error());
if ($myrow = mysql_fetch_array($result)) {
// If records are found, process the following:
$field1=$myrow[“field1”];
$field2=$myrow[“field2”];
$field3=$myrow[“field3”];
<script Language=”JavaScript”>
<!–
var alert_msg = “”; // set as global variable
alert_msg += “Your records have been found and displayed.”;
alert_msg += “nPlease check if the details are correct,”;
// –>
alert(alert_msg);
</script>
[code=php]
}
Can anyone please help me to see where my code might be incompatible with Firefox lates release – ir is is a Firefox bug??
Many Thanks, Paul