Forum Moderators: coopster

Message Too Old, No Replies

Problems with Netscape vrs Internet Explorer

php/mysql not working in netscape

         

Mr_DuMass

10:15 pm on Nov 21, 2004 (gmt 0)



I have a form on a standard html page which works great with IE but Netscape ignores it. Is this normal behavior? what have I done wrong? Here is the code minus the db & password info.

FORM PAGE CODE;
<html>
<head>
<title>Add an Artist</title>
</head>
<body background="/images/scrubback.gif" bgproperties="fixed">
<center><h1>Add Artist To Approved List:<br><br></h1>
<table width=400>
<tr><td>Fill in <font color="red">ALL</font> of the following fields. For questions pertaining to how the information will be used see below the form. <font color="red"><b><br>Only works with INTERNET EXPLORER</b></font></td></tr></table>
<table width=400>

<tr><td> <form action="/add.php" method="post">
<tr><td > Artist/Band Name:</td><td> <input type="text" name="artist" size="30"><br></td></tr>
<tr><td > Artist/Band Email: </td><td><input type="text" name="email" size="30"><br></td></tr>
<tr><td > Artist/Band Website:</td><td> <input type="text" name="website" size="30"><br></td></tr>
<tr><td > Main Genre:</td><td>
<select name="genre">
<option value=""></option>
<option value="Acoustic"> Acoustic</option>
<option value="Alternative"> Alternative</option>
<option value="Ambient"> Ambient</option>
<option value="Americana"> Americana</option>
<option value="Bluegrass"> Bluegrass</option>
<option value="Blues"> Blues</option>
<option value="Classic Rock"> Classic Rock</option>
<option value="Country"> Country</option>
<option value="Dance"> Dance</option>
<option value="Death Metal"> Death Metal</option>
<option value="Easy Listening"> Easy Listening</option>
<option value="Electronica"> Electronica</option>
<option value="Folk"> Folk</option>
<option value="Hard Rock/Metal"> Hard Rock/Metal</option>
<option value="Hip Hop/Rap"> Hip Hop/Rap</option>
<option value="Industrial"> Industrial</option>
<option value="Pop"> Pop</option>
<option value="Punk"> Punk</option>
<option value="Rock"> Rock</option>
</select>
<br></td></tr>
<tr><td > Your Name:</td><td> <input type="text" name="name" size="30"><br></td></tr>
<tr><td > <input type="submit" name="Submit"></td></tr>
</form>
</td></tr></table>
<table width="400"><tr><td>
All of the information you input will be available to the Scrub Radio DJ crew and listening audience EXCEPT for artist contact email due to spam programs that rip email address's out of web pages. The email address of the artist will be used for the purpose of periodically contacting the artists to let them know that they are still being featured on Scrub Radio and thank them for their continuing participation. This will happen approximately once every 3 months.
</td></tr></table><br><br><a href="index.html">Home</a>

</body>
</html>

END FORM PAGE

PHP PAGE CODE START;

<html>
<head>
<title>Add Artist</title>
</head>
<body background="/images/scrubback.gif" bgproperties="fixed"> <center><br><br><br>

<?

if($_POST['Submit']){

// Connect to the mysql database
$connection=mysql_connect("localhost", "DB", "PASSWORD");

// Select a pre-made database in connection
mysql_select_db("scrubradio", $connection);



// Since the form action was set to post, we use
// $_POST['name_of_input_field] to get the values send to
// this script
$artist=$_POST['artist'];
$website=$_POST['website'];
$genre=$_POST['genre'];
$name=$_POST['name'];
$email=$_POST['email'];

// Check to see if they filled out all of the fields.
if (!$artist) {
echo '<B>ERROR: Artist/Band <font color="red">name</font> required!<br>use Back button and try again';
exit;
}
if (!$website) {
echo '<B>ERROR: Artist/Band <font color="red">website address</font> is required!<br>use Back button and try again';
exit;
}
if (!$genre) {
echo '<B>ERROR: Artist/Band <font color="red">genre</font> is required!<br>use Back button and try again';
exit;
}
if (!$name) {
echo '<B>ERROR: You are required to <font color="red">submit your name</font>!<br>use Back button and try again';
exit;
}
if (!$email) {
echo '<B>ERROR: Artist/Band <font color="red">email contact information</font> is required!<br>use Back button and try again';
exit;
}

// Check to see if artist is already in database
$result = mysql_query("SELECT artist,email FROM approved WHERE artist = $artist");
if ($result) {
$row = mysql_fetch_row($result);
echo 'The Artist <b>';
echo $row[0];
echo '</b> was previously approved<br><br><br><a href="/index.html">Home</a> - <a href="/add.html">Add Another</a> ';
exit;
}

// The next thing is to put it in MySQL table in the
// database selected above in the mysql_select_db
// We will assume the table has already been created
// with two collums named 'name' and 'email'.
// Use phpMyAdmin to create the table.

$results=mysql_query("INSERT INTO approved (name, email, artist, website, genre)
VALUES ('$name', '$email', '$artist', '$website', '$genre')") or
die('There was a problem with your submission and the information was not saved.');
mysql_close($connection);
echo'Successfully added the Artist to the Database.<br><br>';

}

?>
<a href="/index.html">Home</a> - <a href="/add.html">Add Another</a>
</body>
</html>

kpaul

10:20 pm on Nov 21, 2004 (gmt 0)

10+ Year Member



did you 'tail' your error_log? if not, check there.

also, double check the tables/html. IE will show 'broken' html, while netscape, i think, won't render it at all.

hth,
kpaul